Welcome Guest, Not a member yet? Register   Sign In
Simple MySQL Query Not Working | Brain Fart?
#3

[eluser]pickupman[/eluser]
I would suggest using the syntax:
Code:
function getGraded($amount,$age) {

  $query = $this->db->get_where($amount, array('age' => $age));  
  return $query->result_array();

This syntax is more secure as the values will be escaped. Likely your error maybe from the age not being inside single quotes possibly, or not having back ticks on the table name is it is numeric. This code should solve both issues.


Messages In This Thread
Simple MySQL Query Not Working | Brain Fart? - by El Forum - 07-26-2012, 11:54 AM
Simple MySQL Query Not Working | Brain Fart? - by El Forum - 07-26-2012, 12:27 PM
Simple MySQL Query Not Working | Brain Fart? - by El Forum - 07-26-2012, 12:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB