<textarea>和MYSQL在php中显示数据 [英] <textarea> and MYSQL to display data in php

查看:51
本文介绍了<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>");
        }

我需要 textarea,因为我希望输出可能很长的评论.我已经查看了有关此问题的其他一些答案,但似乎没有用.

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>";

echo '<td><textarea rows="8" cols="50">' .$row['review']. '</textarea></td>';

这篇关于&amp;lt;textarea&gt;和MYSQL在php中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆