Jump to content

[SOLVED] Where Query


iceblox

Recommended Posts

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

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.