Here's how I currently do it:
$db->query(sprintf('INSERT INTO pages (title, content) VALUES ("%s", "%s")', $db->esc($title), $db->esc($content)));
As you can see I'm manually escaping each string in the above query by passing each string to my $db->esc() method.
First let me indicate that I don't want to use prepared statements.
The best idea I can come up with is to have my $db->query() method wrap sprintf() and automatically call $db->esc() on each string conversion specification - like this:
$db->query('INSERT INTO pages (title, content) VALUES ("%s", "%s")', $title, $content);
That looks great to me, but now my question becomes how do I correctly parse out all the string conversion specifications from the format string and call $db->esc() on each respective argument(before passing that all to sprintf())?
Would you do it a different way?