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 .. Quote 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) Quote Link to comment https://forums.phpfreaks.com/topic/162836-search-list-menu/#findComment-859274 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.