duanjia2415 2014-11-11 22: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-11 22:42
    关注

    Just put it in the tags like this:

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部