ctcp Posted June 18, 2009 Share Posted June 18, 2009 i got DB in my DB i got colum Type (type = Games and movies) how to make search + list menu i mean users can search only games or only movies "select * from db where name like %s and `type` = '%s $select' order by name" my list menu name is select this not work can sombady help me plz .. Link to comment https://forums.phpfreaks.com/topic/162836-search-list-menu/ Share on other sites More sharing options...
MadTechie Posted June 18, 2009 Share Posted June 18, 2009 If you ONLY have two types then just don't include the type in the WHERE clause, if you have more than 2 type and want to limit the results just to those 2 then try this $name = "xyz"; $SQL = sprintf("SELECT * FROM db WHERE name LIKE '%s' AND (`type`= 'Game' OR `type`='Movie') ORDER BY name","%".mysql_real_escape_string($name)."%") Also this is the wrong place to post this, (i'll move it) Link to comment https://forums.phpfreaks.com/topic/162836-search-list-menu/#findComment-859274 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.