I am utilising transactions for some MySQL queries where I am doing multiple inserts across a few tables.
After the transaction has been committed, I am checking the status, throwing an error/exception if it failed.
However, I am struggling to test the case where it fails.
I tried garbling up a column name, but that threw a PHP error instead.
Under what circumstances does a transaction fail, so I can attempt to recreate my own failures for testing purposes?
try to throw an exception inside your sql script using SIGNAL key word. for exmple: