Call to a member function real_escape_string() on a non-object |
When I use the load->database with the seccond param TRUE, I get the error
Code: Severity: Error This happened after upgrade from codeigniter 2 to 3. I cannot find the problem in the upgrading guide. The code I use is: PHP Code: $ci =& get_instance();
Hello bboom,
Where is located the code you provided ? In a controller, a library, helper, core extension, ... ? (12-10-2014, 03:01 PM)bboom Wrote: When I use the load->database with the seccond param TRUE, I get the error Is 'autoinit' set to TRUE for this database? If not, you must call db_connect() manually before executing any queries.
I have the same problem although i have the autoinit set.
I needed to do this inside the Quote:C:\work\Codefi UI\codeigniter\system\database\drivers\mysqli\mysqli_driver.phpto make the error go away. Code: // -------------------------------------------------------------------- (09-02-2015, 09:47 AM)Mdev Wrote: I have the same problem although i have the autoinit set. DO NOT DO THIS! You're making yourself vulnerable to SQL injections!
I have same problem as today, kinda weird thing, in the database.php, I dont see the autoinit constanst , should i just simply added
autoinit =>TRUE Many thanks
In our case this was caused by:
$this->db->close(); Which we added to try to deal with a DDoS attack a few months ago. It didn't help but we left the code in there. Apache didn't seem to care about it but it was an issue when me migrated to Nginx.
|
Welcome Guest, Not a member yet? Register Sign In |