In the example below I am taking an array of the ID's only to turn it into a while and then back into an array only to explode it on the comma on the page. Surely there must be an easier way of doing this.
I am after an array of the $row['ID']s
function get_other_elector_phone($telephone,$current,$criteria){
$the_others = mysql_query("SELECT * FROM electors WHERE telephone = '$telephone' $criteria"); $results = '';
while($row = mysql_fetch_array($the_others)) {
$results .= $row['ID'].','; } return $results;
}
$others = get_other_elector_phone(g('electors',$elector,'telephone'),$elector,$criteria);
if($others){ $others = explode(',',$others);