See comment above about using $db->addQuotes().