php中,一个变量可不可以同时包含一个变量和一串字符的
if($row['id']==1){$num="select*fromnewsorderbyiddesclimit".$row['id']-1.",1";$mysqli-...
if ($row['id']==1){
$num="select *from news order by id desc limit".$row['id']-1.",1";
$mysqli->query($num);
echo "<a href='http://auto.sohu.com/20140731/n402966102.shtml'>".$row['content']."</a>";
echo "<br/>";
}
本人新手,上面代码第二行报错,懂的帮我修改下,谢谢! 展开
$num="select *from news order by id desc limit".$row['id']-1.",1";
$mysqli->query($num);
echo "<a href='http://auto.sohu.com/20140731/n402966102.shtml'>".$row['content']."</a>";
echo "<br/>";
}
本人新手,上面代码第二行报错,懂的帮我修改下,谢谢! 展开
1个回答
展开全部
if ($row['id']==1){
$num="select *from news order by id desc limit".($row['id']-1).",1"; //这里加个括号就可以了
$mysqli->query($num);
echo "<a href='http://auto.sohu.com/20140731/n402966102.shtml'>".$row['content']."</a>";
echo "<br/>";
}
$num="select *from news order by id desc limit".($row['id']-1).",1"; //这里加个括号就可以了
$mysqli->query($num);
echo "<a href='http://auto.sohu.com/20140731/n402966102.shtml'>".$row['content']."</a>";
echo "<br/>";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询