Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] How to get last SQL error
#1

[eluser]fMertins[/eluser]
Hi,

I´m using CI without debug database, so when a SQL error occurs, I detect it with something like this (model):

Code:
$bdok = $this->db->insert('table', $this->mapObj2Array($usua));

Insted of seeing the CI database error page. Then I check for TRUE/FALSE, works fine :-) If got error, gonna have something like this in error file log:

ERROR - 2009-12-12 10:29:32 --> Query error: Table 'foo' doesn't exist

What I´m trying to do is show this error to user in a view, is it possible to get only the error message, without any format/HTML tags? Something like PHP MySQL function mysql_error()?

Thank you!


Messages In This Thread
[SOLVED] How to get last SQL error - by El Forum - 12-12-2009, 06:43 AM
[SOLVED] How to get last SQL error - by El Forum - 12-12-2009, 07:28 AM
[SOLVED] How to get last SQL error - by El Forum - 12-12-2009, 02:12 PM
[SOLVED] How to get last SQL error - by El Forum - 12-12-2009, 04:00 PM
[SOLVED] How to get last SQL error - by El Forum - 12-14-2009, 05:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB