【发布时间】:2012-10-30 05:47:03
【问题描述】:
我查看了许多其他问题,但在其中找不到自己的答案。 这是我的语法错误(意外的 T_IF):
while(($rij1 = mysql_fetch_object($result1))
and( if ($voornaam=NULL) {
$rij2 = ' ';}
elseif($voornaam!=NULL){
$rij2 = mysql_fetch_object($result2);})
我查看了语法前的那一行,但我找不到什么问题... 有人知道吗?
【问题讨论】:
-
那里的
and和if是怎么回事?and期望表达式作为其操作数,而不是语句。你想做什么? -
Please, don't use
mysql_*functions in new code。它们不再维护,deprecation process 已开始使用。看到red box?改为了解prepared statements,并使用PDO 或MySQLi - this article 将帮助您决定哪个。如果你选择 PDO,here is a good tutorial.
标签: syntax if-statement php