I am trying to get this simple function to return the $city. I am getting $person_id from another query.
function get_city()
{
global $person_id;
$query_c = "SELECT city
FROM user_info
WHERE id='$person_id' ";
$results_c = mysql_query($query_c) or die(mysql_error());
$row = mysql_fetch_array($results_c);
$city = $row['city'];
}
below is the snippit of when I try to call it. I don't get any errors, but I don't get any values either.
get_city($person_id);
<td>$city</td>