解决方案 »
- 使用eclipse+zend debugger调试php,apache报错
- 各位大大帮帮忙,有关dede 5.3的伪静态问题
- 求前辈们介绍个好用的PHP产品库程序
- php用上传函数将图片上传到服务器的一个固定的文件夹后,怎样将里面的所有图片都显示出来(就像QQ空间那样)
- 实用apache运行php文件出现浏览器430错误该怎样解决。。。
- php 现在比较主流的持续集成工具是?
- [求助] vtiger迁移问题,请求各位大哥帮我解决。
- 请高手修改源码-由支付宝改成网银,谢谢!急!!!
- 谁知道php目前哪个框架对大数据量的处理比较犀利的??
- 有没有人用过wdcp?为什么centos安装wdcp后成功创建了站点后不能在浏览器中运行?
- httpd域名绑定问题
- fckeditor + swfupload 火狐的 上传按钮 不显示问题
有可能符合你的查询条件的记录只有一条而已。
估计还有 fetchall 等方法
<?php
$timer=$empire->query('select * from {$dbtbpre}ecms_news where classid=5 and keyboard like "'.$r[keyboard].'%" order by newstime desc limit 0,5');
while($r=$empire->fetch($timer)) {
?>
<li><i>·</i><a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>" target="_blank"><?=$r[title]?></a></li>
<?php
}
?> 这段可以返回多条,但整合到上面出错,能帮看看吗
$timer=$empire->query('select * from {$dbtbpre}ecms_news where classid=5 and keyboard like "'.$r[keyboard].'%" order by newstime desc limit 0,5');
while($r=$empire->fetch($timer)) {
?>
<li><i>·</i><a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>" target="_blank"><?=$r[title]?></a></li>
<?php
}
?> 这里因为你用了单引号,所以{$dbtbpre}这个奖变成字符串,这样的话你的表前缀就没有了,那就找不到表了
当然错误
所以这里你要改成
$timer=$empire->query("select * from {$dbtbpre}ecms_news where classid=5 and keyboard like '".$r[keyboard]."%' order by newstime desc limit 0,5");
<?php
$timer=$empire->query('select * from {$dbtbpre}ecms_news where classid=5 and keyboard like "'.$r[keyboard].'%" order by newstime desc limit 0,5');
while($r=$empire->fetch($timer)) {
?>
<li><i>·</i><a href="<?=sys_ReturnBqTitleLink($r)?>" title="<?=$r[title]?>" target="_blank"><?=$r[title]?></a></li>
<?php
}
?> 这段可以返回多条,但整合到上面出错,能帮看看吗
主要单引号和双引号的区别