select id from pch18.fy order by id descstop limit order1 语法错误,why??

每天最多可赚:10金币后才能签到排序:[独家]每天9点更新精选推荐客服中心大章鱼:大章鱼:客户服务热线展开客服友情链接:已有天涯账号?
这里是所提的问题,您需要登录才能参与回答。
"天涯问答"是天涯社区旗下的问题分享平台。在这里您可以提问,回答感兴趣的问题,分享知识和经历,无论您在何时何地上线都可以访问,此平台完全免费,而且注册非常简单。
“query=select from tb_shop id order by id desc limit 0,1”这句话是什么意思?
“query=select from tb_shop id order by id desc limit 0,1”这句话是什么意思?
08-11-16 & 发布
order by id desc是按id进行降序排列 limit 0,1 是只取记录中的第一条. 所以这条语句只能得到一条记录 如想取前10条则 limit 0,10或limit 10 如想取第10至20条则 limit 10,20
请登录后再发表评论!SELECT COUNT(id) as sp_counter FROM (select id,pic, (select cname from service where user=a.user limit 0,1) as cname,
cont, types,name, (select tujian from service where user=a.user limit 0,1)
as tujian,Services, price2, user
from product as a where productclass_id=.. order by types,addtime desc) sp_tmp_table_pager1执行错误: You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near '. order by types,addtime desc) sp_tmp_table_pager1' at line 1
SELECT COUNT(id) as sp_counter FROM (select id,pic, (select cname from service where user=a.user limit 0,1) as cname,
cont, types,name, (select tujian from service where user=a.user limit 0,1)
as tujian,Services, price2, user
from product as a where productclass_id=.. order by types,addtime desc) sp_tmp_table_pager1执行错误: You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near '. order by types,addtime desc) sp_tmp_table_pager1' at line 1
D:\wwwroot\notoko\notokonets\SpeedPHP\Drivers\mysql.php on line 62
&&&&&&&&$this-&arrSql[]&=&$sql;
&&&&&&&&if(&$result&=&mysql_query($sql,&$this-&conn)&){
&&&&&&&&&&&&return&$result;
&&&&&&&&}else{
&&&&&&&&&&&&spError("{$sql}&br&/&执行错误:&"&.&mysql_error());
&&&&&*&返回影响行数
D:\wwwroot\notoko\notokonets\SpeedPHP\Drivers\mysql.php on line 26
&&&&&*&@param&sql&&执行的SQL语句
&&&&public&function&getArray($sql)
&&&&&&&&if(&!&$result&=&$this-&exec($sql)&)return&FALSE;
&&&&&&&&if(&!&mysql_num_rows($result)&)return&FALSE;
&&&&&&&&$rows&=&array();
&&&&&&&&while($rows[]&=&mysql_fetch_array($result,MYSQL_ASSOC)){}
&&&&&&&&mysql_free_result($result);
&&&&&&&&array_pop($rows);
D:\wwwroot\notoko\notokonets\SpeedPHP\Core\spModel.php on line 220
&&&&&*&@param&sql&字符串,需要进行查找的SQL语句
&&&&public&function&findSql($sql)
&&&&&&&&return&$this-&_db-&getArray($sql);
&&&&&*&执行SQL语句,相等于执行新增,修改,删除等操作。
D:\wwwroot\notoko\notokonets\SpeedPHP\Core\spModel.php on line 449
&&&&&&&&$this-&pageData&=&null;
&&&&&&&&$page&=&$this-&input_args[0];
&&&&&&&&$pageSize&=&$this-&input_args[1];
&&&&&&&&@list($conditions,&$sort,&$fields&)&=&$func_args;
&&&&&&&&if('findSql'==$func_name){
&&&&&&&&&&&&$total_count&=&array_pop(&array_pop(&$this-&model_obj-&findSql("SELECT&COUNT({$this-&model_obj-&pk})&as&sp_counter&FROM&($conditions)&sp_tmp_table_pager1")&)&);
&&&&&&&&}else{
&&&&&&&&&&&&$total_count&=&$this-&model_obj-&findCount($conditions);
&&&&&&&&if($total_count&&&$pageSize){
&&&&&&&&&&&&$total_page&=&ceil(&$total_count&/&$pageSize&);
D:\wwwroot\notoko\notokonets\SpeedPHP\Core\spModel.php on line 426
&&&&&*&魔术函数,支持多重函数式使用类的方法
&&&&public&function&__call($func_name,&$func_args){
&&&&&&&&if(&(&'findAll'&==&$func_name&||&'findSql'&==&$func_name&)&&&&0&!=&$this-&input_args[0]){
&&&&&&&&&&&&return&$this-&runpager($func_name,&$func_args);
&&&&&&&&}elseif(method_exists($this,$func_name)){
&&&&&&&&&&&&return&call_user_func_array(array($this,&$func_name),&$func_args);
&&&&&&&&}else{
&&&&&&&&&&&&return&call_user_func_array(array($this-&model_obj,&$func_name),&$func_args);
D:\wwwroot\notoko\notokonets\controller\Services.php on line 97
function&guaishi()
{$sp=spClass("product");
$id=$this-&spArgs("id");
$sql="select&id,pic,&(select&cname&from&service&where&user=a.user&limit&0,1)&as&cname,&&cont,&types,name,&";
$sql=$sql."(select&tujian&from&service&where&user=a.user&limit&0,1)&&as&tujian,Services,&price2,&user&&from&product&as&a&where&productclass_id=$id&order&by&types,addtime&desc";
$this-&guaishi&=&$sp-&spPager($this-&spArgs('p',1),&7)-&findSql($sql);
$sqls="select&count(id)&as&ids&from&product&&where&productclass_id=$id";
$tpl=$sp-&findSql($sqls);
foreach($tpl&as&$rs)
{$this-&cont=$rs["ids"];
D:\wwwroot\notoko\notokonets\controller\Services.php on line 181
function&lists()
{$this-&youxiu();
&&&&$this-&news1();
&&&&$this-&tehuis();
&&&&$this-&guaishi();
&&&&$this-&info();
&&&&$this-&actd="Services";
$this-&display("fwxm/list2.html");
D:\wwwroot\notoko\notokonets\SpeedPHP\spFunctions.php on line 21
&&&&if(!is_object($handle_controller)&||&!method_exists($handle_controller,&$__action)){
&&&&&&&&eval($GLOBALS['G_SP']["dispatcher_error"]);
&&&&//&路由并执行用户代码
&&&&$handle_controller-&$__action();
&&&&//&控制器程序运行完毕,进行模板的自动输出
&&&&if(FALSE&!=&$GLOBALS['G_SP']['view']['auto_display']){
&&&&&&&&$__tplname&=&$__controller.$GLOBALS['G_SP']['view']['auto_display_sep'].
&&&&&&&&&&&&&&&&$__action.$GLOBALS['G_SP']['view']['auto_display_suffix'];&//&拼装模板路径
&&&&&&&&$handle_controller-&auto_display($__tplname);
D:\wwwroot\notoko\notokonets\index.php on line 120
&&&&&&&&&&&&&&&&&&&&&&&&
&spAddViewFunction('utf8shtml','utf8shtml');
&import(APP_PATH.'/functions.php');系统发生错误
You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND id< ORDER BY id desc LIMIT 1' at line 1
[ SQL语句 ] : SELECT * FROM `917uu_article` WHERE lang='cn' AND new_ok=0 AND recycle=1 AND category= AND id< ORDER BY id desc LIMIT 1
FILE: D:\haworks\website\\Api\Lib\Driver\Db\DbMysql.class.php &#12288;LINE: 320
[14-11-13 02:22:11] D:\haworks\website\\Api\Lib\Driver\Db\DbMysql.class.php (320) trace(You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND id< ORDER BY id desc LIMIT 1' at line 1
[ SQL语句 ] : SELECT * FROM `917uu_article` WHERE lang='cn' AND new_ok=0 AND recycle=1 AND category= AND id< ORDER BY id desc LIMIT 1
[14-11-13 02:22:11] D:\haworks\website\\Api\Lib\Driver\Db\DbMysql.class.php (107) DbMysql->error()
[14-11-13 02:22:11] D:\haworks\website\\Api\Lib\Core\Db.class.php (739) DbMysql->query(SELECT * FROM `917uu_article` WHERE lang='cn' AND new_ok=0 AND recycle=1 AND category= AND id< ORDER BY id desc LIMIT 1
[14-11-13 02:22:11] D:\haworks\website\\Api\Lib\Core\Model.class.php (597) Db->select(Array)
[14-11-13 02:22:11] D:\haworks\website\\MyWorld\Lib\Action\cn\IndexAction.class.php (206) Model->find()
[14-11-13 02:22:11]
() IndexAction->show(272)
[14-11-13 02:22:11] D:\haworks\website\\Api\Lib\Core\App.class.php (170) ReflectionMethod->invokeArgs(, Array)
[14-11-13 02:22:11] D:\haworks\website\\Api\Lib\Core\App.class.php (208) App::exec()
[14-11-13 02:22:11] D:\haworks\website\\Api\Lib\Core\Think.class.php (39) App::run()
[14-11-13 02:22:11] D:\haworks\website\\Api\Common\runtime.php (243) Think::start()
[14-11-13 02:22:11] D:\haworks\website\\Api\Core.php (30) require(D:\haworks\website\\Api\Common\runtime.php)
[14-11-13 02:22:11] D:\haworks\website\\index.php (12) require(D:\haworks\website\\Api\Core.php)}

我要回帖

更多关于 order by id desc 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信