duanjia2415 2014-11-12 06:40
浏览 31
已采纳

如何在textarea中显示来自DB的数据

In the following code, I can display the values from the DB in text boxes but how would I display them in the textarea?

<form action="" method="post">
  <input type="hidden" name="id" value="<?php echo $id; ?>"/>
  <div>
     <p>
     <strong>ID:</strong>    
     <?php echo $id; ?>
     </p>
     <strong>userid: </strong>    
     <input type="text" name="userid" value="<?php echo $userid; ?>" /><br/>
     <strong>name: </strong>     
     <input type="text" name="name" value="<?php echo $name; ?>" /><br/>
     <strong>phoneno: </strong>      
     <input type="text" name="phoneno" value="<?php echo $phoneno; ?>" /><br/>
     <strong>emailid: </strong> 
     <input type="text" name="emailid" value="<?php echo $emailid; ?>" /><br/>
     <strong>description: </strong>    
     <textarea name="description" value="<?php echo $description; ?>" rows="5" cols="40">    </textarea>
</form> 
  • 写回答

4条回答 默认 最新

  • dongmu1951 2014-11-12 06:42
    关注

    Just put it in the tags like this:

    <textarea name="description" rows="5" cols="40"><?= $description; ?></textarea>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入