hi
my code is this,
$query = "SELECT * FROM `cars` WHERE (color LIKE '%". $key ."%' OR name LIKE '%". $key ."%') AND enabled = 'yes' ORDER BY `ID`";
database is like this
ID color name enabled
---- ------ -------- ---------
1 red red car yes
2 blue blue car yes
3 brown brown car yes
r
when i search with the key "red" it returns first field (ID 1) but if i search with "red car" it returns nothing.
how can i search both 2 field ?
thanks
EDIT: i fixed brackets but still i cant get results with more than 1 word keys.
Tried this with no luck
$query = "SELECT * FROM `cars` WHERE (MATCH (color,name) AGAINST ('$key' IN BOOLEAN MODE)) AND enabled = 'yes' ORDER BY `ID`";
EDIT 2: Peter is right. There is no problen in query. weird thing is i use this
$key = $_GET['key'];
if $_GET['key'] is more than 1 word, $key is returns empty for a reason.