Reputation: 398
I used
<textarea name="question" class="input" width="250"></textarea>
to add data in sql. i used multi line , in database also data is stored in multi line only.
Then i used
$question=$row['1'];
echo "<tr><td colspan='5'>",$row[1],"</td></tr>
to display the data but the data are displaying in single line . how to make it appear in mulit line like as in database.
Upvotes: 1
Views: 1115
Reputation: 4860
Correct
echo "<tr><td colspan='5'>",$row[1],"</td></tr>
To
echo "<tr><td colspan='5'>".nl2br($row[1])."</td></tr>";
Upvotes: 5
Reputation: 1554
You need to convert the newlines to HTML line breaks. Try PHP's nl2br
:
echo "<tr><td colspan='5'>".nl2br($row[1])."</td></tr>
Upvotes: 2