title: Setting to cause php error on duplicate entry attempt to unique fields?
body: <p>In our PHP application, currently mysql query errors (syntax errors, duplicate entry errors for unique keys) are not throwing PHP errors, and script execution is continuing, which is fine. </p>
  
  <p>I just want to know what setting (if it can be controlled by a setting) can stop script execution in the above mentioned cases, so that we are well aware and do not unknowingly do this by mistake.</p>
  
  <p>I just read this question <a href="https://stackoverflow.com/questions/812437/mysql-ignore-insert-error-duplicate-entry">MySQL - ignore insert error: duplicate entry</a>, which is about avoiding errors on duplicate entry attempts on unique fields. The answer by @zombat mentions using <code>insert ... ignore</code> to cause warnings instead of errors when there is a duplicate data entry attempt. So, it seems like a duplicate entry attempt (using <code>insert</code> and not <code>insert ... ignore</code>) causes a PHP error and script execution stops. Is this the default behavior? </p>
  
  <p>I am not getting the PHP errors, at the first place. So, how do I get them?</p>