Jump to content

[SOLVED] Text Area with MySQL Results


bigrossco

Recommended Posts

I have been able (with help from this form) get a text box to display information from my database but I now want to change this code:

[code]echo 'Announcement: <input type="text" name="text" value="'. $row['text'] .'"><br>';[/code]

To display as a Text Area when I try:

[code]echo 'Announcement: <textarea name="text" value="'. $row['text'] .'"></textarea><br>';[/code]

All I get is a blank box and it dose not show the results in it but works fine when used as a text box.

Any help would be great

PS Hope you all had a good xmas!
Link to comment
https://forums.phpfreaks.com/topic/31947-solved-text-area-with-mysql-results/
Share on other sites

thanks this dose show the text but now I want ato be able to modify it adn send it back to the database, when i try:

[code]
<?php
echo "<textarea name="text"> ".$row['text']." </textarea><br>";
?>
[/code]

I get the error message:

Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\update-announcement.php on line 140

Any ideas?
On a little side note bigrossco, if you're using quotation marks inside of the value you're setting (such as inside a variable or echo) remember to escape the quotation marks with a backslash, as follows:
[code]<?php
echo "<textarea name=\"text\"> ".$row['text']." </textarea><br>";
?>
[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.