,取值输出有关问题

WBOY
Release: 2016-06-13 12:26:38
Original
807 people have browsed it

求助,取值输出问题

$idss = '3,2,7,5';<br />$re = $db->findall('select id,title from aaa where id in('.$idss.')');<br />foreach($re as $list){<br />   echo $list['id'].',';<br />}
Copy after login

输出结果是:2,3,5,7
怎么才能让它按照$idss的顺序输出:3,2,7,5, 呢?谢谢!

------解决思路----------------------
$re = $db->findall("select id,title from aaa where id in($idss) order by fiind_in_set(id, '$idsd')");
Copy after login

------解决思路----------------------
<br />$re = $db->findall("select id,title from table where find_in_set(id, ".$idss.")");<br />
Copy after login


试试。

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!