Jump to content

[SOLVED] if statement help please


netpants

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.