Hi. I’m in need of some help. I’m trying to make my php query work for 2 types of searches when searching a map database. I.m executing this by url.
This is what I have now:
$query = “SELECT *, ( 3959 * acos( cos( radians($latitude) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians($longitude) ) + sin( radians($latitude) ) * sin( radians( latitude ) ) ) ) AS distance FROM UNA HAVING distance < 30 ORDER BY distance LIMIT 0 , 50”;
I call this search by using
http://example.com/mapdata.php?latitude=30.549&longitude=-90.419
This works fine. But I would also be able to search by a zip code function, such as:
http://example.com/mapdata.php?zip=70401
How can I add Zip=$zip to my original code so I can use either url? I tried using the OR function and couldn’t get it to work. I’m a newb so any help is appreciated!
