sql shorthand not working for me |
[eluser]battlemidget[/eluser]
Code: function get_product_by_id($id) error: Code: A Database Error Occurred sql: Code: mysql> select product.* from product where product.id = '440'; What exactly am i doing wrong? $ pacman -Q mysql apache php mysql 5.1.38-1 apache 2.2.13-2 php 5.3.0-3 CI 1.7.2 EDIT: I've also done this very same thing on another CI project and it worked: Code: function getPropertyBySearch($loc, $p_start, $p_end, $bed) All settings are the same and both run on virtual ips on same box.
[eluser]guillermo, out of repose[/eluser]
[pre] function get_product_by_id($id) { $this->db->select('*')->from('product')->where('id', $id); $query = $this->db->get(); return $query->result(); } [/pre]
[eluser]battlemidget[/eluser]
Thanks but my problem is trying to deal with sql shorthand syntax
[eluser]guillermo, out of repose[/eluser]
Haven't tried this, but give it a shot and see what happens. More on the second parameter of the $this->db->select() can be found in the user guide: [pre] function get_product_by_id($id) { $this->db->select('product.*', false)->from('product')->where('product.id', $id); $query = $this->db->get(); return $query->result(); } [/pre]
[eluser]battlemidget[/eluser]
[quote author="guillermo, out of repose" date="1253752582"]Haven't tried this, but give it a shot and see what happens. More on the second parameter of the $this->db->select() can be found in the user guide: [pre] function get_product_by_id($id) { $this->db->select('product.*', false)->from('product')->where('product.id', $id); $query = $this->db->get(); return $query->result(); } [/pre][/quote] This works! Thanks for the quick response! -adam |
Welcome Guest, Not a member yet? Register Sign In |