It depends how you're doing error handling in general. Using transactions is nice, because if your code inside the transaction throws an exception (which may OR MAY NOT be because a database query failed), normally your exception handler will cause a rollback to happen.
Moreover, if you closed the connection without committing, for example because the process quit unexpectedly, the rollback would happen implicitly, which is generally a good thing (it improves robustness, because when the process restarts, it can try again)
Now, of course, using PHP and the "old" mysql API is not conducive to getting this right, as it doesn't support error reporting by exceptions.
You can however, workaround it by registering a PHP error handler which throws an exception when an error occurs, rather than doing the default "charge headlong into disaster" method:
"Captain, we've hit an iceberg
"Full steam ahead, put more coal in, we'll get to new york soon...