Jump to content

php die() doesn't end script??


hitokirikensan

Recommended Posts

I'm a complete newb at programming so please bear with me

i'm trying to check to make sure my sql query

 

          $result=mysql_query("SELECT screenname FROM users WHERE privacy='0'");

 

shows the correct results so i did a print_r($result); die();

 

but when i reload the page, it shows a syntax error after the die();

 

isn't the script suppose to completely stop so syntax errors after die() shouldn't matter?

 

also i'm expecting the $result to be an array of names and i wanted to do a query to another table to grab comments from each of those screennames, is the only way to do a for loop of mysql queries?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/225287-php-die-doesnt-end-script/
Share on other sites

Already solved? Meh.

 

PHP has to parse the file before it can execute it. If doesn't know that the script can't possibly get passed a certain point. All it cares about, at that moment, is whether the file has proper syntax. If not, it will complain.

 

__halt_compiler() is an exception to the rule.

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.