Search code examples
javascriptphphtmltinymcewysiwyg

editing existing story from database using WYSIWYG


i use Ck editor or Tinymce for adding a blog,but when the blog is saved in database and i want to edit that using these editors then some of the content is either lost for most of the stories or it will show '>' marks. which i doubt is happening coz in mysql raw HTML is saved which can't be retrieved in a textarea managed by WYSIWYG editor. any suggestions?

$query="SELECT * FROM blogs WHERE `id`=".$id;
             $run=mysqli_query($conn,$query);
             while($row=mysqli_fetch_array($run)){
                     $title=$row['title'];     
                     $story=$row['story'];
                }
        <textarea name="textarea" value="<?php echo $story ?>"></textarea>

Solution

  • Please replace to bellow

    <textarea name="textarea"><?php echo $story ?></textarea>