Home > php教程 > php手册 > 关于where like解决办法

关于where like解决办法

WBOY
Release: 2016-06-06 19:43:06
Original
1030 people have browsed it

关于where like $s="%".addcslashes($uid,'%_')."%"; returnDB::fetch_all('select*from%twhereuidlike%slimit%d,%d',array($this-_table,$s,$start,$perpage)); 上面的一段代码可以查询出关于UID是某位数字的用户全部信息 请问下在这段代码里加点什么可以是

关于where like
<br />
$s="%".addcslashes($uid, '%_')."%";<br />
return DB::fetch_all('select * from %t where uid like %s limit %d,%d',array($this->_table,$s,$start,$perpage));<br />
Copy after login


上面的一段代码 可以查询出 关于UID是某位数字的用户全部信息

请问下 在这段代码里加点什么 可以是调用出来的信息 按信息ID的从大到小“【本文来自鸿网互联 (http://www.68idc.cn)】desc”排序?
------解决思路----------------------
$s="%".addcslashes($uid, '%_')."%";
return DB::fetch_all('select * from %t where uid like %s order by id desc limit %d,%d',array($this->_table,$s,$start,$perpage));
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template