Canman2005 Posted April 13, 2007 Share Posted April 13, 2007 Hi all Something strange is happening. I have an if statement, it looks like if($_GET['folder'] != 4) { $sql = "UPDATE `messages` SET `read` = 1 WHERE `id` = ".$_GET['id'].""; $query = mysql_query($sql); exit(); } So it should run that query if the url looks like page.php?folder=1 and if the url looks like page.php?folder=4 then it shouldnt run, as the ?folder= value in the url is 4 But for some reason, this rule isnt happening and if the url contains ?folder=4 Does anyone know why this isnt working correcly? Any help would be great Thanks Dave Link to comment https://forums.phpfreaks.com/topic/46792-if-statement-not-running-correctly-prob-something-simple/ Share on other sites More sharing options...
btherl Posted April 13, 2007 Share Posted April 13, 2007 Try echo "GET_folder = " . $_GET['folder'] . "<br>"; either just before the if, or inside the if. Link to comment https://forums.phpfreaks.com/topic/46792-if-statement-not-running-correctly-prob-something-simple/#findComment-228113 Share on other sites More sharing options...
Canman2005 Posted April 14, 2007 Author Share Posted April 14, 2007 thanks, worked great Link to comment https://forums.phpfreaks.com/topic/46792-if-statement-not-running-correctly-prob-something-simple/#findComment-229454 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.