Reputation: 103
I'm trying to pull some html data from a mysql database to populate a text area.
I'm doing some tests with the home page content data and it only displays the last half of the html code I'm trying to select.
I can't wrap my head around all this problem!
Here is the textarea code I'm trying to use:
<textarea style='width:600px;height:300px;' name='' value='<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("cgscms") or die(mysql_error());
$sql = 'SELECT * FROM content where page_id ="1"';
$result = mysql_query($sql);
while($row = mysql_fetch_array( $result )) {
echo $row['content'];
}
?>'></textarea>
Upvotes: 0
Views: 1042
Reputation: 5986
Text area doesn't use Value. Try putting it between the textarea tags
<textarea> put it here </textarea>
But another thing is if there are any quotes it will interfere with the quotes around value=""
Wrap the content result with htmlentities()
Upvotes: 6