Possible Duplicate:
PHP PDO bindParam with html content
I'm using PDO prepared statement to insert/update a new blog article for my web app. Everything is being entered in to the database except the article body, which contains HTML tags from a WYSIWYG editor.
Let' say $content
contains <p>This is a test article</p>
. It just won't insert using a prepared statement. However, it will insert the data if I don't use the prepared statement.
How can I get around this issue?
Here is my query:
$SQL = "UPDATE blog_articles SET topic_id = :topic_id, title = :title, ";
$SQL .= "title_slug = :title_slug, description = :description, ";
$SQL .= "keywords = :keywords, content = :content WHERE article_id = :article_id;";
$STH = $DBH->prepare($SQL);
// other binds ...
$STH->bindParam(':content', trim($content));
// other binds ..
$STH->execute();