I want to show publications according to the interests (in keywords) of the users.
USERS TABLE
id | username
5 | joelsilva
PUBLICATIONS TABLE
id | publication title
8 | The best car of the year!
TABLE OF INTERESTS
id | username | interest
8 | joelsilva | car
9 | joelsilva | year
It shows all the publications with the car title and year on the home page.
I've tried this:
$pubs = mysql_query(
"SELECT *
FROM PUBLICATIONS
WHERE (interest LIKE '%".$interests."%')
ORDER BY id desc"
) or die(mysql_error());
It works, but only with one type of interest in the table. If adding more than one interest shows nothing.