Code: Select all
$query = "SELECT zone FROM zones WHERE city = '$city' and state = '$st'";
$result = mysql_query( $query );
$rows = mysql_num_rows($result);
if ($rows == 0) {
$zone = 99;
}
else {
$zone = $result;
}SELECT zone FROM zones WHERE city = 'Aurora' and state = 'IL'
If I run that query directly from the database, the resulting zone is 5. However, from the program, the resulting zone is 99. It's always 99. I've tried several approaches including putting the result into an array, but I always get 99 instead of the actual zone.
Would someone point me in the right direction? I know it's me, but I cannot figure out why it doesn't work.