I'm trying to insert content into a MySQL and it looks like that:
table name is foo
and the columns are:
id INTEGER,
name VARCHAR(50),
content VARCHAR(255),
url VARCHAR(255)
the problem arises when I'm trying to insert string which has quotes and double quotes inside it and escaping must be done since when inserting strings into MySQL you need to surround it in single quotes.
How do I escape the following text ?
'<div><a href='http://www.ynet.co.il/articles/0,7340,L-4391031,00.html'><img src='http://www.ynet.co.il/PicServer3/2013/06/11/4677612/AP0AMR108-Main-2013-05-25T16-54-20.070Z239775_a.jpg' alt='צילום: AP' title='צילום: AP' border='0' width='116' height='116'></a></div>בית המשפט העליון אישר בהחלטה תקדימית לחיילים ושוטרים להצביע בבחירות - לראשונה מאז שנות ה-70. האיסלאמיסטים זעמו על הפסיקה בעוד הליברלים ואנשי האופוזיציה בירכו: "יש מדינות שמעניקות לאנשי הצבא שלהן להצביע בבחירות ובהם דרום אפריקה, ברזיל, הודו, רוסיה, ארצות הברית, ואפילו ישראל"'