in code igniter you can type:
$query = $this->db->query("YOUR QUERY");
foreach ($query->result() as $row)
{
echo $row->title;
echo $row->name;
echo $row->body;
}
i guess that the query method returns the object it's part of. am i correct?
if i am, how do you type the line where it returns the object?
so what i wonder is how it looks like inside the query method for the above code to be functional.
public function query($sql) {
// some db logic here with the $sql and saves the values to the properties (title, name and body)
return X
}
with other words, what should X be?