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.
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.
I just read this question MySQL - ignore insert error: duplicate entry, which is about avoiding errors on duplicate entry attempts on unique fields. The answer by @zombat mentions using insert ... ignore
to cause warnings instead of errors when there is a duplicate data entry attempt. So, it seems like a duplicate entry attempt (using insert
and not insert ... ignore
) causes a PHP error and script execution stops. Is this the default behavior?
I am not getting the PHP errors, at the first place. So, how do I get them?