[eluser]stevefink[/eluser]
Hi all,
I couldn't find an Active Record way of writing this code, I'm curious however, what is the proper way to write this using query bindings?
Code:
function select_id($db) {
// This function is responsible for returning the latest
// id of the db snapshot for $db
$sql = 'SELECT id FROM dbsnap
WHERE name like "%' . $this->db->escape($db) . '%"
ORDER BY id
DESC LIMIT 1';
return $this->db->query($sql, $db);
}
Thanks for any suggestions.