PHP's or die operator can be set to display the exact SQL statement that failed, which is useful for debugging but is potentially a vulnerability where somebody can learn about your database by seeing the SQL statements. This shows how to copy the errant SQL into the MySQL/MariaDB command line to get the best error messages.