I would like to make this more searchable, currently if you search for something in two different columns it returns nothing, if I searched for an artists name, and an album in the same search I get nothing.
Would I have to make $trimmed an array of words? If so, would this be a good way to search the DB?
[code=php]
$var = $_GET[‘q’];
$trimmed = trim($var);
$query = “SELECT artist,lyric,title,album,
MATCH(lyric, artist, album, title) AGAINST (‘$trimmed’ IN BOOLEAN MODE)
AS score
FROM lyrics
WHERE artist LIKE ‘%$trimmed%’ OR lyric LIKE ‘%$trimmed%’ OR title LIKE ‘%$trimmed%’ OR album LIKE ‘%$trimmed%’
AND MATCH(lyric, artist, album, title) AGAINST (‘$trimmed’ IN BOOLEAN MODE) ORDER BY score”;