Select Multiple Ids from a table

前端 未结 2 761
萌比男神i
萌比男神i 2020-12-13 15:02

I want to select some id\'s based on url string but with my code it displays only the first. If i write manual the id\'s it works great.

I have a url like this http:

2条回答
  •  鱼传尺愫
    2020-12-13 16:01

    You can also try FIND_IN_SET() function

    $SQL = "select * from info WHERE FIND_IN_SET(`id`, '$ids')"
    

    OR

    $SQL = "select * from info WHERE `id` IN ($ids)"
    

提交回复
热议问题