Hi Oatley,
My best guess would be NOT to do it. Personally I don't see the point of spending all the extra effort to find out how this would be possible.
Don't get me wrong, I'm all up for a Query-method, I use it myself all the time:
PHP Code:
function query($sql) {
$result = $this->db->query($query);
if(!$result) {
$this->log_error($this->db->error . "Full query: ".$sql);
return FALSE;
} else {
return TRUE;
}
}
// disclaimer: I've just typed this up without checking if I did it right as I'm at work. Please forgive any typo's or naming.
As you can see, this saves me from logging every single query error seperately, as my objects query function handles this. The only variable being passed through is the SQL query itself, which is built up within the object and then passed through to this function. Big plus is building the query directly at the place where you need the result, thus not having to worry about passing through different variables, query types (SELECT, UPDATE), joins and all that.
Regards,
Martin