0
votes

I'm using a simple update query like:

$db->query("UPDATE " . TBL_NAME . " SET title = :title, content = :content WHERE id = :id",array("title"=>$title,"content"=>$content,"id"=>$id));

Only my 'content' field/textarea is an WYSIWYG Editor, so it put HTML chars in the post, but the query does the update without the HTML tags (strong,p,li,etc.)

I saw on a forum that I probably need the following line: $db->bindValue(':$content', $content, PDO::PARAM_STR); instead of: $db->bindValue(':$content', $content);

How do I get the 'PDO::PARAM_STR' connected to the 'content' field with this class? Or is there another way to do this

Can somebody please help me out?

ps: I use this class: https://github.com/indieteq/PHP-MySQL-PDO-Database-Class

1

1 Answers

0
votes

You are missing the : characters in your parameter names:

array("title"=>$title,"content"=>$content,"id"=>$id)

...should be:

array(":title"=>$title,":content"=>$content,":id"=>$id)