出于某种原因,PHP出现在我的文本框中

出于某种原因,PHP出现在我的文本框中,php,html,Php,Html,这是我的密码: <textarea> <? while ($row = mysql_fetch_array($result)) { echo $row[0], $row[1] . "\n"; ?> </textarea> 然后将其输出到textarea框并创建第二个框: <? while ($row = mysql_fetch_array($result)) { echo $row[0], $row[1] . "\n";

这是我的密码:

<textarea>
<?
while ($row = mysql_fetch_array($result)) {
    echo $row[0], $row[1] . "\n";
    ?>
</textarea>

然后将其输出到textarea框并创建第二个框:

<?
while ($row = mysql_fetch_array($result)) {
    echo $row[0], $row[1] . "\n";
    ?>

有了长长的标签和卷曲的大括号,我现在明白了!哈哈:

<br />
<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\globaldetroit\index.php on line <i>23</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0006</td><td bgcolor='#eeeeec' align='right'>672248</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\globaldetroit\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0037</td><td bgcolor='#eeeeec' align='right'>679240</td><td bgcolor='#eeeeec'><a href='http://www.php.net/mysql_fetch_array' target='_new'>mysql_fetch_array</a>
(  )</td><td title='C:\wamp\www\globaldetroit\index.php' bgcolor='#eeeeec'>..\index.php<b>:</b>23</td></tr>
</table></font>

(!)警告:mysql_fetch_array()希望参数1是资源,布尔值在第23行的C:\wamp\www\globaldetroit\index.php中给出 调用堆栈 #时间记忆功能定位 10.0006672248{main}()..\index.php:0 20.0037679240 ()..\index.php:23

当我删除SQL代码中的“ordered by”语句时,此错误消失。

尝试此操作,您的服务器上可能会禁用短标记:

<?php
while ($row = mysql_fetch_array($result)) {
echo $row[0], $row[1] . "\n";
?>

short_open_标记被设置为off或PHP未运行

请尝试:

<textarea>
<?php
while ($row = mysql_fetch_array($result)) {
    echo $row[0], $row[1] . "\n";
}
?>
</textarea>


好吧,这似乎是可行的,sorta,现在我有这样一个问题:解析错误:语法错误,第34Oh行的C:\wamp\www\globaldetroit\index.php中意外的$end和另一个Jake的Hi Jake。Hi!问题是,}起作用了,但是如果我的SQL中有“ordered by”,它会导致一个错误!这是怎么回事?看来你仍然坚持在一个文本区域中编辑整个数据库内容的想法。如果我是你父亲…有人记得当整个网站看起来像那个错误信息吗?
<textarea>
<?php
while ($row = mysql_fetch_array($result)) {
    echo $row[0], $row[1] . "\n";
}
?>
</textarea>