Ok, i am working with a dating script that i am trying to enhance the search by zip option. here is the original code...
} elseif ( ( $searchby == 'zip' ) ) {
$sql = 'SELECT DISTINCT user.*, floor(period_diff(extract(year_month from NOW()),extract(year_month from birth_date))/12) as age FROM ' . USER_TABLE ." as user WHERE status in ('Active','".$lang['status_enum']['active']."') AND user.id > 0 AND user.id<>'" . $_SESSION['UserId'] ."' AND user." . $searchby . " like '%" . $searchtxt . "%'";
$querystring = array('searchtype'=>'simple','searchby'=>$searchby,'txtsearch'=>$searchtxt);
}
$searchtxt is what the user enters in for their zip.
i got that part down, but i am trying to find out how to seearch more than one zip code. I have a script that will give me all of the zip codes within an X mile radius, but i am unsure of how to put them in the $sql variable so it will return more than just the users in one zip code.
ex :
$sql = "SELECT zip FROM * WHERE zip='$endzip', zip='$endzip_again'.....";
how would i do that?
Thanks!
Tim