Jump to content

Left Join Help


phpretard

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.