I'm trying to setup a query that will return all rows in the database with the same subject.
Let's say our subject is: "We love beer." I want to return every row that contains the word "beer" So it will show titles like "Beer is cool" or "Beer is very nice" I want to return every row that contains the word beer. But the problem is, the subject is not always the same..
So I tried this in MySQLi:
$query = "SELECT * FROM cms_news WHERE subject LIKE '%".$subject."%'";
$result = mysqli_query($dbc, $query) or die('Whoops-> Query failed!');
But it only returns itself, the row with the exact same title. Now I read something about the SQL CONTAIN function, but I can't quite understand how it works.