php mysql search in 2 columns in 2 tables.
- by andrew fishwick
Hey,
I have two tables in one DB, one called Cottages and one called Hotels.
In both tables they have the same named fields.
I basically have a search bar that i want it to search in both of the fields in both of the tables. (the two fields being called "Name" and "Location"
SO far I have
$sql = mysql_query("SELECT * FROM Cottages WHERE Name LIKE '%$term%' or Location LIKE '%$term%' LIMIT 0, 30");
But this only searches the Cottages table, how can I make it search both the cottages and hotel tables?
Andy