I would like to do a search in many tables with a
<input type="text" name="search" />
$sql = mysql_query("SELECT * FROM cars,people,cities WHERE
cars.reg= '$search' || people.phone = '$search' || city.address = '$search'");
Is it possible to do that? any suggestions for that a DB search with PHP?
Thanks a lot
You could use a UNION ALL query
It’s important that you return the same type of field from all the subqueries. Read here for more info, basically the idea is that you return a UNION of all data found from the queries.