Error using Query Builder - CI_DB_postgre_driver |
Morning,
I'm trying to ue the Query Builder in Codeigniter 3 but when I try run the CI show the error below (Line in red): Fatal error: Call to undefined method CI_DB_postgre_driver::get() in /var/www/store/application/models/Category_model.php on line 33 A PHP Error was encountered Severity: Error Message: Call to undefined method CI_DB_postgre_driver::get() Filename: models/Category_model.php Line Number: 33 Backtrace: Model $this->db->select('*'); $this->db->from('products') $query = $this->db->get(); return $query; Obs.: My database file config (database.php) is set with: $query_builder = TRUE;
Did you load the database?
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(06-01-2016, 01:49 PM)InsiteFX Wrote: Did you load the database? Yes, I am load database in autoload file. I was hoping that show me the result. When I change the code and no use query builder its work. Follow the code bellow: $sql = "select * from category"; return $this->db->query($sql)->result(); (06-01-2016, 01:22 PM)wellerson2004 Wrote: $this->db->select('*'); Not sure if it just your editing to simplify but you are missing a semi-colon. PHP Code: $this->db->select('*'); // not needed as this is the default Try this and see if it works PHP Code: $results = FALSE; Hope it helps, Paul. |
Welcome Guest, Not a member yet? Register Sign In |