0

这个 php 代码有什么问题?

$sql = mysql_query("select * from news where isActive = 1 and partnerid_fk = '$partnerid'");
$news = "";
while($row = mysql_fetch_assoc($sql)) {
    news .= "<li class='news-item'><a href='#'>" . $row['news'] . "</a></li>";
}

新闻附加行上的错误:

Syntax error. 
4

1 回答 1

4

您忘记了美元符号:

news .= 

应该

$news .= 
于 2013-01-20T15:44:54.290 回答