Hi guys,
Does anyone know the SQL statement that returns all records that contain a certain word?
My table has fields called Artist, Title, Genre. for example how do i get all the records that have the word 'test' in either of the fields.
thanks
For an exact match:
$query = mysql_query("SELECT * FROM your_table WHERE Artist='test' OR Title='test' OR Genre='test'");
If not exact, use LIKE
$query = mysql_query("SELECT * FROM your_table WHERE Artist LIKE '%test%' OR Title LIKE '%test%' OR Genre LIKE '%test%'");
Cgraz