Catch database error message - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Catch database error message (/showthread.php?tid=62813) |
Catch database error message - popay - 08-29-2015 I have error message when try to access my controller PHP Code: A PHP Error was encountered this is my controller in CodeIgniter 2.x and worked : PHP Code: $dsn = $_POST['mysql_db_driver'].'://'.$_POST['db_username'].':'.$_POST['db_password'].'@'.$_POST['mysql_db_host'].'/'.$_POST['mysql_db_name']; and I change it in CodeIgniter 3.0 to : PHP Code: $dsn = $_POST['mysql_db_driver'].'://'.$_POST['db_username'].':'.$_POST['db_password'].'@'.$_POST['mysql_db_host'].'/'.$_POST['mysql_db_name']; Line number 94 is $db_error = $this->db->error(); Please help me RE: Catch database error message - pdthinh - 08-30-2015 (08-29-2015, 07:51 AM)popay Wrote: I have error message when try to access my controller According to CI doc $this->db->error() returns an array containing its code and message. PHP Code: // PHP 5.4.0 http://www.codeigniter.com/user_guide/database/queries.html#handling-errors RE: Catch database error message - popay - 08-30-2015 Code: A PHP Error was encountered Code: Configuration doesn't saved Still get error message Array to string conversion |