hi;
please help to check this code. i have a fucntion name to use in my select dropdown list, and I problem in calling the the function name;
here is the whole code of my function.
function getAllR($Region_id) {
//returns an array with city info
$query="SELECT * FROM cityinfo where Region_index='$Region_id'";
$result=mysql_query($query);
if (!$result)
return false;
else {
$i=0;
$returnArray=array();
while ($row=mysql_fetch_array($result)) {
$returnArray[$i]=new city();
$returnArray[$i]->City_id=$row['City_id'];
$returnArray[$i]->Region_index=$row['Region_index'];
$returnArray[$i]->displayName=$row['City_name'];
$i++;
}
return $returnArray;
}
}
here the whole code of my dropdown list
$cities=region::getAllR();
if (!isError($cities)){
foreach ($cities as $element => $value) {
echo '<option value="'.$value->City_id.'"';
if ($value->City_id=='$city')
echo ' selected="selected"';
echo '>'.$value->displayName.'</option>';
}
}
}
what is wrong in this code? why it does not display the item for the dropsown list?
please i need your help, thanks advance