ai didi

php - PHP中的附加变量导致语法错误

转载 作者:行者123 更新时间:2023-12-03 08:16:05 24 4
gpt4 key购买 nike

这个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. 

最佳答案

您忘记了美元符号:

news .= 

应该
$news .= 

关于php - PHP中的附加变量导致语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14426163/

24 4 0
文章推荐: ruby - 我的Ruby编程代码有什么问题?
文章推荐: visual-studio - 如何从 Visual Studio ASP.NET Web API 应用程序禁用 Docker?
文章推荐: reactjs - 如何修复 Material-UI Select w/MenuItem ,其中 MenuItem 水平渲染?
文章推荐: python - Python代码在 “if self.hp < 0”行返回语法错误
行者123
个人简介

我是一名优秀的程序员,十分优秀!

滴滴打车优惠券免费领取
滴滴打车优惠券
全站热门文章
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com