Asterixx Posted April 5, 2006 Share Posted April 5, 2006 [code]<?mysql_connect("localhost","usr","pw"); mysql_select_db("my_db"); $search=$_POST["search"];$result = mysql_query("SELECT * FROM my_table WHERE zip LIKE '%$search%'");//grab all the contentwhile($r=mysql_fetch_array($result)){ $zip=$r["zip"]; $contact=$r["contact"]; $address=$r["address"]; echo "$zip <br> $contact <br> $address <br>";}?>[/code]This is a simple thing to more advanced users. I need to query more than just "my_table" to get the results; the other tables I need to query hold the exact same info as "my_table". I tried delimiting with comas, as in "my_table, my_othertable, my_moretable", but that brought up a SQL error.Thanks a bunch in advance,Stephan. Link to comment https://forums.phpfreaks.com/topic/6671-query-several-databases-from-search-field/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.