CodeIgniter Forums
How to get the SQL error message - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to get the SQL error message (/showthread.php?tid=14733)



How to get the SQL error message - El Forum - 01-13-2009

[eluser]fMertins[/eluser]
Hi, I´m using the simple_query() function to execute a delete statement, like this one (in a model):

Code:
public function delete($id) {
   $id = (int) $id;
   $bdok = $this->db->simple_query("delete from cliente where idcliente = {$id}");
   return $bdok;
}

So, if the statement fails, returnt FALSE. But how may I get the error message from database? For example, a foreign key violation message...

Thanks!
Fernando


How to get the SQL error message - El Forum - 01-21-2009

[eluser]fMertins[/eluser]
Hello... Anyone know if this is possible to implement? Thanks!