Jump to content
Larry Ullman's Book Forums

Recommended Posts

In the following code would you leave the part in where it says or trigger error and so on, on a live site 

 

mysqli_query($dbc, $i) or trigger_error("Query: $i\n<br />mysqli Error: " . mysqli_error($dbc));

Share this post


Link to post
Share on other sites

ok , so then should we include this line of code on every mysqli_query() we do on our site, including, select, insert, update, delete?

 

 or trigger_error("Query: $i\n<br />mysqli Error: " . mysqli_error($dbc));

Share this post


Link to post
Share on other sites

The benefit of this line is that it includes the query with the error message. If that's useful to you, you'd use this wherever you want that. If that's not needed, you can forgo trigger_error() and the mysqli_error() will be caught by your error handler instead. 

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...