Jump to content

Recommended Posts

I need to know how to write an if statement. For example I have a form dropdown called Cook, and Kendall, if someone selects Cook it will look in a certain table in the database, or if someone chooses Kendall it will look in a different table. Heres what I have currently it only works from one table.

 

$result = mysql_query("SELECT * FROM coords WHERE city='$city' AND county='$county' AND street='$street'")

 

What do I need to put in there for the if statement to say if $county == Cook then search in a different table that I will create. I will eventually have 7 different counties I will need to put if statements for.

Link to comment
https://forums.phpfreaks.com/topic/75805-solved-if-statement-help-please/
Share on other sites

There are eventually going to be over 91,000 entries into the database, so I thought by dividing it up into different tables it would make it a little faster when someone searches the database.

 

Eatch of the counties has its own field, there is a field called county in my table.

There are eventually going to be over 91,000 entries into the database, so I thought by dividing it up into different tables it would make it a little faster when someone searches the database.

 

Eatch of the counties has its own field, there is a field called county in my table.

91K isn't enough to make it worthwhile.

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.