post data in textarea

hi guys.
I am trying to post a data in textarea.

The data is not showing in the textarea. I don’t know why.
here is my code.

<?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("get", $con); $result = mysql_query("SELECT * FROM get"); while($row = mysql_fetch_array($result)) { $row['grammar']; } mysql_close($con); ?>

<?=htmlstripchars($row[grammar]);?>

Try to change your code to this:
[php]<?php
// … connect to a database code …
$result = mysql_query(“SELECT * FROM get”);
if(mysql_num_rows($result)){
$row = mysql_fetch_array($result);
}
?>
<?php echo htmlstripchars($row['grammar']); ?>
[/php]

Also, is this function defined somewhere else in your code: htmlstripchars() ?
Maybe you mean to use php’s function htmlspecialchars()?

thank you for the help sir :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service