grahamgr3 Posted December 16, 2014 Share Posted December 16, 2014 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)); Link to comment Share on other sites More sharing options...
Larry Posted December 16, 2014 Share Posted December 16, 2014 Yes, absolutely. Then, in your custom error handler, you'd handle the error appropriately. Link to comment Share on other sites More sharing options...
grahamgr3 Posted December 16, 2014 Author Share Posted December 16, 2014 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)); Link to comment Share on other sites More sharing options...
Larry Posted December 18, 2014 Share Posted December 18, 2014 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. Link to comment Share on other sites More sharing options...
Recommended Posts