'Fetch data and display it in a form

I am using wysiwyg editor, in my form where the user can input text, I also wish to display the data that is previously place in that parameter in database.

In task title I get the value under task_title as shown below

<div class="form-group">
    <label class="col-lg-3 control-label">Task Title:</label>
        <div class="col-lg-8">
            <input class="form-control" name="task_title" value="<? echo $task_title; ?>" type="text">
        </div>
</div>
        

However in the code given below I have value in task_desc but I am not able to display the data in task_desc

<div class="form-group">
    <label class="col-lg-3 control-label"> Description: </label>
        <div class="col-lg-8">
            <textarea class="wysihtml5 form-control" rows="6" name="task_desc" value="<? echo $task_desc; ?>"></textarea>
        </div>  
</div>


Solution 1:[1]

Textarea value inside the element Try this

<textarea class="wysihtml5 form-control" rows="6" name="task_desc" ><? echo $task_desc; ?></textarea>

Solution 2:[2]

Try this

<?php
$task_desc = "sample";
?>
<textarea class="wysihtml5 form-control" rows="6" name="task_desc" ><?php echo $task_desc; ?></textarea>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Muhammad Ali
Solution 2 Padmanathan J