Hi everyone,
I’ve never come across this before, so I’m wondering if this is normal behaviour, or if I have done something wrong.
I have a function in a model like this:
function MyFunction($id)
{
$this->db->where('primaryID', $id);
$query = $this->db->get('MyTable');
return $query->result();
}
If an $id is not sent to the function (I know this shouldn’t happen but…) the query runs like this:
SELECT * FROM MyTable WHERE primaryID
This returns all the data from MyTable, which is very bad.
Should the Active Record class not automatically shield queries like this??
Thanks,
Nick.
