PDA

View Full Version : PHP/MySQL Search Script


Hyper22
05-05-2005, 04:51 AM
Hi everyone, new to this forum. I posted this thread at another board I go to and got referred here by a member over there. Hope someone here can help me!

I'm having a little bit of trouble with this query.

$searchquery = mysql_query("SELECT * FROM tracks WHERE lyrics='%$term%' ORDER BY title ASC");

Basically, I want it to search the tracks table and return results that have $term somewhere in the lyrics field. It isn't giving me any results, though. I've narrowed it down to the
lyrics='%$term%'
part. I think I know why it's doing it, though I have no solution for the problem. Any help would be appreciated.

Kiwi
05-05-2005, 11:29 AM
lyrics LIKE "%$term%"