Вопрос

I am trying to retrieve data from mysql and put into text area. Others data that insert to text box works well but i faced problem when want to insert into text area.

echo'<textarea name="abstract" id="abstract" size="200" value="'.$abstract.'"></textarea>';

I have fetch my query out with

    $result = mysql_query("SELECT * FROM publication where file_id='$id'");
    $row1 = mysql_fetch_array($result);
    $abstract=$row1['abstract'];

Thanks for helping me...

Это было полезно?

Решение

Try this one

echo'<textarea name="abstract" id="abstract" size="200">'.$abstract.'</textarea>';

or 
<textarea name="abstract" id="abstract" size="200"><?php echo $abstract?></textarea>

Другие советы

Textarea doesn't have value tag:

echo'<textarea name="abstract" id="abstract" size="200">'.$abstract.'</textarea>';

use as

echo '<textarea name="abstract" id="abstract" size="200">'.$abstract.'</textarea>';

You need to put your $abstract like this :

echo'<textarea name="abstract" id="abstract" size="200">'.$abstract.'</textarea>';

Try this

<textarea name="abstract" id="abstract" size="200" ><?php echo $abstract; ?></textarea>

If you want to avoid concatenation you could enclose the variable within curly braces to avoid any confusion, if it does, in the following manner

echo "<textarea name='abstract' id='abstract' size='200'>{$abstract}</textarea>";
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top