From: lists Date: 2005-10-21T08:57:45+09:00 Subject: Re: Escaping single quotes in SQL queries On Oct 19, 2005, at 11:30 PM, Yohanes Santoso wrote: > > db.execute('INSERT INTO table VALUES (?,?)', > message_num, message_text) On Oct 19, 2005, at 11:31 PM, Jamis Buck wrote: > 2. Use bind variables: > > db.execute( "INSERT INTO table VALUES (?, ?)", 1, "This won't > work" ) That did the trick, thanks Yohanes and Jamis! > 1. Use SQLite3::Database.quote: > > message_text = SQLite3::Database.quote("This won't work") I didn't know about that one (obviously) so thanks for passing that along. -Ryan