Jump to content

IF statement - not running correctly, prob something simple


Canman2005

Recommended Posts

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

 

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.