How to store data which contains quotes in MySQL

mysql, php

Solution

You use a PDO prepared statement (or mysql_real_escape_string)

Problem

In one of my forms I use the rich text editor from Yahoo!. Now i want to store the data from that textarea in a MySQL database. The user can enter anything in that textarea, e.g. many double or single quotes. How can I store that data? Normally we store by adding that data in one variable and then put that in sql, but the quotes cause problems.

Original source

Related problems