Nothing returned when using SQL query builder |
Hi,
This topic follow the now-closed issue #4614 on Github. Here is the problem : Quote:I'm pretty new to Code Igniter, but something does bother me ... it seems that some query built using query builder doesn't work. I was invited to test the result of the last query with echo $this->db->last_query(); Here is the result : PHP Code: // The code Do you have any idea of what is wrong here ? Obviously, the query is not correct, but why is MYDATA under 3 ' ?
http://www.codeigniter.com/user_guide/da...ng-queries
Code: $query = $this->db->get_where('table1', array('name' => strtoupper($this->db->escape_str($name))));
Query Builder - the values are escaped automatically by the system.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
InsiteFX is correct. I wrote something stupid. So:
Code: $query = $this->db->get_where('table1', array('name' => strtoupper($name))); (05-06-2016, 07:29 AM)ivantcholakov Wrote: http://www.codeigniter.com/user_guide/da...ng-queries Thanks for your reply. ![]() (05-06-2016, 01:28 PM)InsiteFX Wrote: Query Builder - the values are escaped automatically by the system. Thanks for your reply. So, the examples given in the documentation are 100% secure ? And $sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?"; $this->db->query($sql, array($_POST['id'], $_POST['status'], $_POST['author'])); is a correct way to do queries ? |
Welcome Guest, Not a member yet? Register Sign In |