How can PHP query multiple IDs at the same time?

Source: Internet
Author: User
 
  GetRow ($sql);        $server = $db->getrow (' select * from '. Tname (' server '). ' Where cd_id= '. $row [' Cd_server '].        if ($row) {                $CD _url= $row [' Cd_url '];                        $playurl = $server [' Cd_url ']. $CD _url;        echo
 
  
   
  '
   ;
 
  }? >


The above code is read only for a single ID
Show
xx.php?id=5555

What if I want it to show the results of multiple IDs?
For example: xx.php?id=5555,6666,1111
The relative display is



What's the whole thing?


Reply to discussion (solution)

In (5555,6666,1111)

In (5555,6666,1111)

It's got two tables on it, it's not going to be written.

Global $db, $ar =explode (', ', $CD _id), foreach ($ar as $CD _id) {        $sql = ' Select * from '. Tname (' DJ '). ' Where cd_id= '. $CD _ ID. ";        $row = $db->getrow ($sql);        $server = $db->getrow (' select * from '. Tname (' server '). ' Where cd_id= '. $row [' Cd_server '].        if ($row) {                $CD _url= $row [' Cd_url '];                        $playurl = $server [' Cd_url ']. $CD _url;        echo
 
  
   
  '
   ;
 
  }}

PHP Code
?



1234567891011

Global $db; $ar =explode (', ', $CD _id); foreach ($ar as $CD _id) {$sql = ' Select * from '. Tname (' DJ '). ' Where cd_id= '. $CD _id. '; $row = $db->getrow ($sql); Thank you, sir. How do you get that point?

PHP Code
?



1234567891011

Global $db; $ar =explode (', ', $CD _id); foreach ($ar as $CD _id) {$sql = ' Select * from '. Tname (' DJ '). ' Where cd_id= '. $CD _id. '; $row = $db->getrow ($sql);

So the result is. Chained together ...

Can I display it as a branch?



Echo ' . ' \ n ";

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.