Database Error Codes |
[eluser]blcArmadillo[/eluser]
How should I go about getting the error code if a query fails. Right now CI just uses the DB error page to output the error code and such. Is there a way I can get the code so that my program can respond appropriately? I know there are functions such as mysql_errno and mysqli->errno. Should I just use these or is there some built in CI function that would better suited for my needs? Thanks for the help.
[eluser]crnalajna[/eluser]
You may extend DB_mysql_driver and do what you want with that data. Example, you may send email with that error but not show it to user. /application/libraries/MY_DB_mysql_driver.php Code: class MY_DB_mysql_driver extends CI_DB_mysql_driver { To be able to extend CI_DB class you need to extend Loader class first. http://codeigniter.com/wiki/Extending_Database_Drivers/ |
Welcome Guest, Not a member yet? Register Sign In |