searching a mysql database
Posted
by Bill Parson
on Stack Overflow
See other posts from Stack Overflow
or by Bill Parson
Published on 2010-04-20T16:16:40Z
Indexed on
2010/04/20
16:23 UTC
Read the original article
Hit count: 263
currently i have a database of music that i have db'd in mysql, now i am writing a php frontend for it, and it will list out everything in a table, it works, but if i search "the beatles" it gives me 453 results(correct) however if i just search "beatles" it results in 0 rows, how would i go about making it able to search for something like that?
heres my current line:
$query2 = "SELECT * From `songs` WHERE `Artist` like '".$_REQUEST['q']."'
OR `Album` like '".$_REQUEST['q']."' OR `Genre` like '".$_REQUEST['q']."'
OR `Title` like '".$_REQUEST['q']."';";
© Stack Overflow or respective owner