in reply to SQL quoting problem

I've had a problem similar to this. Usually I ended up doing something like:

$statement = something.... $dbh->do($statement);

And that's worked for me, but I haven't been doing anything with single quotes.