I'd like to search a MySQL database to match keywords passed by the user. I heard that using LIKE
is the fastest option but can't find an example of a full simple query using LIKE in PHP code.
This is what I am tring:
$value = 'Fire';
$result = mysql_query("SELECT * FROM effects WHERE title LIKE 'value%'");
I know there is an row in the database with Fire
as the title but the query is returning null
.
Can someone please give me an example of how to perform a MySQL LIKE search or alternative to find rows by keyword(s).
Thank you.