So first I do this:
$zip_code_array = mysql_query("SELECT * FROM zip_code WHERE (lon BETWEEN '$lng_min_rnd' AND '$lng_max_rnd') AND (lat BETWEEN '$lat_min_rnd' and '$lat_max_rnd')") or die (mysql_error());
while($zip_code_cells = mysql_fetch_array($zip_code_array))
{
$zip_codes_raw = $zip_code_cells['zip_code'];
$zip_codes_in_distance .= $zip_codes_raw.", ";
}
This works and spits out the zipcodes like this EX: 07110, 07111, 07112 etc: But then I do this:
$user_list_array = mysql_query("SELECT * FROM member_search WHERE IN($zip_codes_in_distance) AND gender = '$gender_of_interest_session'");
while($user_list = mysql_fetch_array($user_list_array))
{
$id_from_array = $user_list['id'];
$username_from_array = $user_list['user_name'];
$defaultpic_from_array = $user_list['defaultpic'];
$city_from_array = $user_list['city'];
}
I get Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on
$user_list_array = mysql_query("SELECT * FROM member_search WHERE IN($zip_codes_in_distance) AND gender = '$gender_of_interest_session'");
I can't seem to figure out the proper way to query the list of zipcodes it comes out with. I do believe it has something to do with when I turn the zip code result into a string and have all of the zip codes seperated by a comma.