Welcome Guest, Not a member yet? Register   Sign In
Transaction and error handling
#2

[eluser]InsiteFX[/eluser]
Managing Errors

If you have error reporting enabled in your config/database.php file you'll see a standard error message if the commit was unsuccessful. If debugging is turned off, you can manage your own errors like this:
Code:
$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->trans_complete();

if ($this->db->trans_status() === FALSE)
{
     // generate an error... or use the log_message() function to log your error
}
If it returns FALSE then you know that this is the database query that caused the Error!

InsiteFX


Messages In This Thread
Transaction and error handling - by El Forum - 03-31-2011, 07:04 AM
Transaction and error handling - by El Forum - 03-31-2011, 07:52 AM
Transaction and error handling - by El Forum - 03-31-2011, 07:53 AM
Transaction and error handling - by El Forum - 03-31-2011, 07:56 AM
Transaction and error handling - by El Forum - 03-31-2011, 07:58 AM
Transaction and error handling - by El Forum - 03-31-2011, 08:05 AM
Transaction and error handling - by El Forum - 03-31-2011, 09:00 AM
Transaction and error handling - by El Forum - 03-31-2011, 10:16 AM
Transaction and error handling - by El Forum - 03-31-2011, 10:18 AM
Transaction and error handling - by El Forum - 03-31-2011, 10:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB