0

我有这个 PHP 代码,我收到这个错误:解析错误:语法错误,意外的 '}',期待 ';' 在第 120 行的 [文件位置]

while($array etc etc) 所在的行是第 120 行。

if($numrows != 0)
{
    do
    {
        //echo "<a href='approve.php?ref=" . $array['id'] . "'>Your '" . $array['keywords'] . "' article has been written and needs to be reviewed.</a>";
        //echo "<br />";
    } while($array = mysql_fetch_array($result)) //While there are still rows in the SELECT query.
}

想法?我一定是个盲人。谢谢!

4

4 回答 4

7

} while($array = mysql_fetch_array($result))

应该

} while($array = mysql_fetch_array($result));

做时

顺便说一句,该代码片段看起来可能应该使用while循环,除非您故意使用$array第一次的旧值。

于 2012-11-06T08:38:08.783 回答
0

在您的 while 语句结束时 a ; 不见了 :)while($array = mysql_fetch_array($result));

于 2012-11-06T08:39:18.313 回答
0

语句;末尾缺少分号while

while($array = mysql_fetch_array($result)); //<---- add semicolon here
于 2012-11-06T08:39:26.770 回答
0
                if($numrows != 0)
                {
                    do
                    {
                        //echo "<a href='approve.php?ref=" . $array['id'] . "'>Your '" . $array['keywords'] . "' article has been written and needs to be reviewed.</a>";
                        //echo "<br />";
                    } while($array = mysql_fetch_array($result)); //While there are still rows in the SELECT query.
                }

你忘了; 经过一段时间的条件

于 2012-11-06T08:39:26.850 回答