Welcome Guest, Not a member yet? Register   Sign In
Transactions. Which query failed?


I plan to use transactions with db_debug turned off.
Assuming that one of the three queries have failed, is there anyway to know which query failed and what the error message was?

I tested it out with 3 queries, where queries 1 and 3 succeed and query 2 fails. I tried to get hold of the query with following code but it is returning the last query , query 3 (which succeeds if executed)
if ($this->db->trans_status() === FALSE)
    echo 'Query that failed was '.$this->db->last_query().'<br />';
    # above line is returning query 3
So, is there a way to get hold of the query that failed using the transactions in the above mentioned manner?

Thank you.

Theme © iAndrew 2016 - Forum software by © MyBB