php 从数据库输出到textarea

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9296405/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 06:30:40  来源:igfitidea点击:

Outputting to textarea from database

phphtml

提问by Molecular Man

I'm trying to out put a database field value into a text area by doing this but it's not working.

我试图通过这样做将数据库字段值放入文本区域,但它不起作用。

<textarea name="course_id" cols=40 rows=3 value="<?php echo $row['course_id'] ; ?>"></textarea>

but when i use

但是当我使用

<input type="text" name="course_id" value="<?php echo $row['course_id'] ; ?> ">

it worked well.

它运作良好。

Thanks.

谢谢。

回答by Darvex

You enter the value between textarea tags.

您在 textarea 标签之间输入值。

<textarea name = "course_id" cols=40  rows=3>
<?php echo $row['course_id'] ?>
</textarea>

回答by Molecular Man

textarea doesn't have value attribute. You have to echo in between the tags. The correct code would be:

textarea 没有 value 属性。你必须在标签之间回声。正确的代码是:

<textarea name = "course_id" cols=40  rows=3 ><?php echo $row['course_id']; ?></textarea>

回答by Sam T

Check this out

看一下这个

There is no value field for Textarea

Textarea 没有值字段

So you need to give your value inside the <textarea><?php echo $yourdatabaseResult;?></textarea>tags

所以你需要在<textarea><?php echo $yourdatabaseResult;?></textarea>标签中给出你的价值

回答by Ashish Yadav

echoyour data between tags follow this step :-

请按照以下步骤在标签之间回显您的数据:-

<TextArea>
<?php echo $showdbdata; ?>
</TextArea>

回答by mallika

echo your data in textareafor laravel

textarealaravel 中回显您的数据

<textarea type="text" name="job_detail" class="form-control" style="width: 100%; height: 150px; ">{{  $job[0]->job_detail }}</textarea>