![]() |
Database error after upgrading to CI 1.7 - 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: Database error after upgrading to CI 1.7 (/showthread.php?tid=13031) |
Database error after upgrading to CI 1.7 - El Forum - 11-07-2008 [eluser]KeyStroke[/eluser] Hi, I'm having a problem here after upgrading CodeIgniter from 1.6.3 to 1.7.0 . The application doesn't detect my databases anymore. I keep getting this error: Quote:A Database Error Occurred What could be wrong? I've followed the instructions carefully, and all my database settings are correct. Your help is much appreciated. Database error after upgrading to CI 1.7 - El Forum - 11-07-2008 [eluser]KeyStroke[/eluser] I just removed the 1.7 files from "system/database" and replaced them with the 1.6.3 files and my application works again. What's the problem with the 1.7.0 database files? Database error after upgrading to CI 1.7 - El Forum - 11-08-2008 [eluser]Sergi Ortega [TEAMVALLES][/eluser] Hello, I had the same problem two days ago when actualized CI to 1.7.X DB Class in CI 1.6.X (Active Record) don't escape automatically queries. Example: Code: $this->db->select("*,DATE_FORMAT(created,'%d-%m-%Y %h:%m:%s') as created_format")->from("foo"); The problem is that CI 1.7.X automatically escapes strange chars for preventing SQL Injection such as ( and ' and %. CI 1.7.X now has a second parameter in SELECT method (ESCAPE OR NOT / TRUE, FALSE), by default TRUE. So in CI 1.7.X the same query is like this: Code: $this->db->select("*,DATE_FORMAT(created,'%d-%m-%Y %h:%m:%s',FALSE) as created_format")->from("foo"); In 1.7.X if you're programming basic queries like: Code: $this->db->select("*")->from("foo"); Second parameter (ESCAPE OR NOT) don't to be passed due Select query * don't need to be escaped because haven't any strange injection chars. Good Luck! Database error after upgrading to CI 1.7 - El Forum - 11-08-2008 [eluser]KeyStroke[/eluser] Thanks for your response, but how is this related to my problem? As you can see, my problem is that CodeIgniter doesn't even find my tables in the first place, so it can't run my queries on them. Database error after upgrading to CI 1.7 - El Forum - 11-08-2008 [eluser]Sergi Ortega [TEAMVALLES][/eluser] Hi again! Try it! I was getting mad by the problem (the same problem you have (don't find the tables!!)) Finally I fix this issue explained in my last post and It works ;-) May be isn't your problem by It works for me. BTW, See your BBDD config file in CI and check that all is ok! Regards & GL. |