Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php sql查询在使用limit时返回错误_Php_Sql_Mysql - Fatal编程技术网

Php sql查询在使用limit时返回错误

Php sql查询在使用limit时返回错误,php,sql,mysql,Php,Sql,Mysql,为什么这个查询有效?我该怎么写呢 select * from tbl_content order by year desc where visible = '1' limit 0,30; WHERE子句位于ORDER BY之前 重写为: select * from tbl_content where visible = '1' order by year desc limit 0,30; WHERE子句位于ORDER BY之前 重写为: select * from tbl_content

为什么这个查询有效?我该怎么写呢

select * from tbl_content order by year desc where visible = '1' limit 0,30;

WHERE子句位于ORDER BY之前

重写为:

select * from tbl_content where visible = '1'  order by year desc limit 0,30;

WHERE子句位于ORDER BY之前

重写为:

select * from tbl_content where visible = '1'  order by year desc limit 0,30;