So I have two tables I want to join.
table 1(cars): carID, userID, entryTitle, entryDesc, price, tags
tabe 2(users): userID, username, password
From a search field, I want to pull up all the car details as well as show the username of the person who posted that entry for any entry that has a title or tag that matches the searched keyword.
Here is my query:
"SELECT * FROM cars, users WHERE cars.userID = users.userID AND entryTitle LIKE '%".$searchTerm."%' OR tags LIKE '%".$searchTerm."%'"
I am not sure if it makes any difference, but the TAGS column stores multiple tags (usually less than 3) delimited by spaces.
I get the typical join problem of there being WAY too many results due to table multiplication. When I run this query without the Join, it works fine of course.
I've used this join before and it works fine, but my guess is that the LIKE part of the query is causing some problems.