'$i' order by nid>'$byNid"/> '$i' order by nid>'$byNid">
Home > Backend Development > PHP Tutorial > 几个MYSQL查询,不知道对不对,该怎么解决

几个MYSQL查询,不知道对不对,该怎么解决

WBOY
Release: 2016-06-13 12:47:05
Original
822 people have browsed it

几个MYSQL查询,不知道对不对,

<br />
$byNid=$n['Nid']-500;<br />
$s="select nid,name,i from biao where name='$name' and i>'$i' order by nid>'$byNid' desc";<br />
Copy after login


已知nid是肯定大于500以上,
Nid是自增,从现在的Nid(如Nid=1000) 减去500,那就是从 Nid 500 开始到 1000 查询
i字段有3种数字,分别是  0,1,2 

以上的语句是可以得到  nid 500起到最新的nid 1000 止,
得到变量name,i大于1的排序,而且是从大到小的排序。

语法对吗?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template