phpretard Posted August 14, 2008 Share Posted August 14, 2008 One county can have 50 zipcodes. Well if I only have one county in the MEMBERS TABLE i would like to show up for any of the 50 zipcodes when the zipcode is searched. If you look at SAINT THOMAS as the County it has several zipcodes (I am reffering to the attachment). Remmber: I am searching the MEMBERS table...it has the counties only and they are comma seperated. The ZIPCODE table (attached) has the counties listed multiple times for each zipcode. Here is my current search: $mainSearch=$_POST['mainSearch']; $result = mysql_query("SELECT * FROM members WHERE (City='$mainSearch' OR State='$mainSearch' OR ZipCode='$mainSearch' AND $service='1') AND PaidID!='' ORDER by id"); $num_rows = mysql_num_rows($result); if ($num_rows > 0){ while($row = mysql_fetch_array($result)) { RESULT } Just as an example if I search the MEMBERS table for ZipCode 00801 - 00805 I would like to somehow cross references the ZIPCODE Table for a result. I really think I need an expert in this one. I have searched high and low. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/119660-left-join-help/ Share on other sites More sharing options...
Jabop Posted August 14, 2008 Share Posted August 14, 2008 This should be in MySQL Help Link to comment https://forums.phpfreaks.com/topic/119660-left-join-help/#findComment-616459 Share on other sites More sharing options...
phpretard Posted August 14, 2008 Author Share Posted August 14, 2008 So how do I move it? Link to comment https://forums.phpfreaks.com/topic/119660-left-join-help/#findComment-616463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.