Jump to content

Search query problem


aram

Recommended Posts

Hi i have this code for making a search in my tables but it only gets those searches that contain numbers, my problem is i want to get string searches too.

$sql = "(SELECT *,'kurdi' AS `table` FROM kurdihewal WHERE title LIKE '%" . $searchkey .  "%' OR id LIKE '%" . $searchkey ."%') UNION ALL(SELECT *,'iraq' AS `table` FROM iraqhewal WHERE title LIKE '%" . $searchkey .  "%' OR id LIKE '%" . $searchkey ."%') UNION ALL(SELECT *,'cihan' AS ``table FROM cihanhewal WHERE title LIKE '%" . $searchkey .  "%' OR id LIKE '%" . $searchkey ."%')ORDER BY id DESC LIMIT $start, $limit";

Link to comment
Share on other sites

What is $searchkey? There's nothing there telling it to only look for numbers.
$searchkey=serach words tha the user searchs for its a variable for the words that enters from the search form.you mean there is nothing wrong in this code?
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...