iceblox Posted April 14, 2008 Share Posted April 14, 2008 Hi Guys not sure if im being blonde but im having issues with the following query; if($_GET['NetworkName'] == "") { $net = "NetworkName <> 'Pay As You Go' AND NetworkName <> 'SIM Free' AND"; } elseif($_GET['NetworkName'] == "All") { $net = ""; } elseif($_GET['NetworkName'] == "PAYG") { $net = "NetworkName = 'Pay As You Go' OR NetworkName = 'SIM Free' AND"; } elseif($_GET['NetworkName'] == "Monthly") { $net = "NetworkName <> 'Pay As You Go' AND NetworkName <> 'SIM Free' AND"; } else { $net = "NetworkName = '$_GET[NetworkName]' AND "; } Basically when NetworkName = PAYG it shows every row with either Pay As You Go or SIM Free in them ignoring other if queries which state a paticular modelid. If this makes sense? I have tried AND and this shows no results at all. Link to comment https://forums.phpfreaks.com/topic/101101-solved-where-query/ Share on other sites More sharing options...
craygo Posted April 14, 2008 Share Posted April 14, 2008 have you tried putting it in parenthesis around it $net = "(NetworkName = 'Pay As You Go' OR NetworkName = 'SIM Free') AND"; Also echo out your query before you run it and see what it says. Ray Link to comment https://forums.phpfreaks.com/topic/101101-solved-where-query/#findComment-517066 Share on other sites More sharing options...
iceblox Posted April 14, 2008 Author Share Posted April 14, 2008 Thanks craygo, Worked a treat Link to comment https://forums.phpfreaks.com/topic/101101-solved-where-query/#findComment-517067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.