in reply to Escape single quotes in a SQL query
Did you try a Google Search? This is quite a known problem. Also read up on Placeholders and Bind Values from the DBI documentation
Hope this helps