I’m trying to get results for articles that have a title or subcategory name similar to the request.
Table 1
Subcategory_ID Subcategory_Name
Table 2
Article_ID Title Subcategory_ID
Now I need to fetch articles from table 2 where title or subcategory_names match what we’re looking for.
Here is what I have, but I can’t come up with the rest
SELECT table1.*, table2.* FROM table1,table2 WHERE table2.title = '%keyword%'
and the rest I mess up…
What is the solution?
With MySQL INNER JOIN it is implicit if you use “table1.Subcategory_ID=table2.Subcategory_ID” in the WHERE clause.