Jump to content

[SOLVED] what does this mean "!$result"


kigroy

Recommended Posts

What do call the exclamation point in the following code:

 

if (!$result) {
    $message  = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $query;
    die($message);
}

 

I don't know what it's called so I can't look it up at php.net.  ???

 

Thanks...

Link to comment
https://forums.phpfreaks.com/topic/137153-solved-what-does-this-mean-result/
Share on other sites

$result is referring to the outcome of

$result = mysql_query($sql);

If the query works, it returns with a resource id pointer (equivalent to TRUE), and if it fails it returns FALSE.

 

That code says:

if("if NOT TRUE // if equivalent of FALSE") {

  //show the query debug errors

}

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.