I’m scraping a feed and adding the values to a database.
One of the values is description. Description is freestyle so there can be any character.
How do I insert the values into the database to display it on a webpage later.
I want to keep the description and title text as is.
…
$title = $item['title'];
$href = $item['link'];
$desc = $item['description'];
$query = "INSERT INTO FEED_CONTENT (title, link, desc) VALUES ('".mysql_real_escape_string($title)."','".$href."',
'".mysql_real_escape_string($desc)."')";
…
Thanks
Using mysql_real_escape_string with the magic quotes enabled will escape your data twice.
While outputting those content you can use stripslashes function.
EDIT
descis mysql reserved word and you must enclosedescin backticks “