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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.