MySQL中查询正常,PHP中却报错
原帖地址是这里:
http://topic.csdn.net/u/20091206/11/3c626084-5ecb-4489-a51d-058a963cb151.html
我在Mysql中查询如下语句是正常的:
SQL code:
select w.author,sum(t.ct) sumnum
from writer w left join
(select t1.arcid,format(1/count(*),1) ct
from writer t1,content t2
where t1.arcid=t2.id and t2.islock=1
group by arcid) t
on w.arcid=t.arcid
group by w.author
order by sumnum desc
limit 30;
而在PHP中运行,却报错如下:
SQL code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') t ON w.arcid = t.arcid GROUP BY w.author limit 0,1' at line 5
不知道是什么问题,望高手指教,谢谢
首先排出php的错误!~再确定是否真的这条语句不能运行的问题。有时候你要考虑到IE缓存的问题。关掉IE重新执行php页面
为什么你报错的内容和sql不一样呢
') t ON w.arcid = t.arcid GROUP BY w.author limit 0,1'
我的程序还自己编译一次,用的是ThinkPHP1.5
问题已经解决了,是编译的时候,多加了缓存安全检查
相关问答:
各位大侠
求一段php代码
可以实现以下功能
针对不同的浏览器显示不同的图片
就是有一张图片,只想给ie6用户看到
如果ie7、chrome、firefox用户浏览则显示另外一张图片  ......
<!--购买数量-->
<div class='buyinfo'>
<table width='auto'>
<tr>
<td><span>购买数量:</sp ......
代码如下:
function uc_get_user($username, $isuid=0) {
$return = call_user_func(UC_API_FUNC, 'user', 'get_user', array('username'=>$username, 'isuid'=>$isuid));
return UC_CONNECT == 'mysql' ......
我刚学习php请问,如果我把php文件上传至服务器后,例如http://www.****.com/cast.php这个文件会不会被别人下载或复制阿?
可以被下载,也可以不被下载,看web服务器对该文件权限的配置
看你对文件权限的设置
......
我已经按照教程上配置tomcat的server.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = &quo ......