Home  >  Article  >  Backend Development  >  PHP如何同时查询多个ID

PHP如何同时查询多个ID

WBOY
WBOYOriginal
2016-06-13 12:50:221131browse

PHP怎么同时查询多个ID?

<?php<br />
include 'include/cmsdj.conn.php'; <br />
$CD_ID=SafeRequest('id','get');<br />
        global $db;<br />
        $sql='Select * from '.tname('dj').' where CD_ID='.$CD_ID.'';<br />
        $row=$db->getrow($sql);<br />
        $server=$db->getrow('select * from '.tname('server').' where CD_ID='.$row['CD_Server'].'');<br />
        if($row){<br />
                $CD_Url=$row['CD_Url'];<br />
                        $playurl=$server['CD_Url'].$CD_Url;<br />
        echo '<list><m src="'.$playurl.'" label="'.$row['CD_Name'].'"/></list>';}<br />
?>


上面代码是只读取单个ID的
显示
XX.php?id=5555

如果我要它显示多个ID的结果呢?
比如:xx.php?id=5555,6666,1111
相对显示的是



要怎么整呢?


------解决方案--------------------
echo ''."\n";
Statement:
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