< textarea>和MYSQL在PHP中显示数据 [英] <textarea> and MYSQL to display data in php
本文介绍了< textarea>和MYSQL在PHP中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
好,所以当我尝试使用MYSQL查询和<textarea>
显示数据时,它崩溃了并且无法运行.
在没有文本区域的情况下,它可以很好地工作(但并非所有数据都适合文本框).
OK so when I try to display data using a MYSQL query and a <textarea>
it crashed and dose not run.
It works well without text area (but not all the data fits in the text box).
波纹管是代码.
while($row = mysql_fetch_array($result_reviews))
{
echo "<td>" .$row['username']. "</td>";
echo "<td>" .$row['title']. "</td>";
//echo "<td>" .$row['review']. "</td>";
echo "<td><textarea rows="8" cols="50">" .$row['review']. "</textarea></td>";
echo ("<td><a href=\"editreview.php?id=$row[id]\">
<button>Edit Review</button></a></td>");
echo ("<td><a href=\"delete.php?id=$row[id]\">
<button>Deleat Review</button></a></td></tr>");
}
我需要文本区域,因为我希望输出的评论可能会很长. 我已经查看了针对此问题的其他一些答案,但似乎没有用.
I need textarea as there is a review I wish to output that can be quite long. I have looked at some of the others answers for this problem and non seem to work.
推荐答案
可能会引起双引号冲突. 试试
Maybe a conflict with double quote. Try
echo "<td><textarea rows=\"8\" cols=\"50\">" .$row['review']. "</textarea></td>";
OR
echo '<td><textarea rows="8" cols="50">' .$row['review']. '</textarea></td>';
这篇关于< textarea>和MYSQL在PHP中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文