Codeigniter selecting data with multiple id's

后端 未结 1 1809
情歌与酒
情歌与酒 2021-01-03 13:57

Here is an example of my code and an explanation what I am trying to do.

At the beginning of the code I am selecting three variables in my database. I then compare t

相关标签:
1条回答
  • 2021-01-03 14:22

    Try using where_in()

    $ids = array(33, 34, 45);
    $dbStations->where_in('id', $ids);
    // Produces: WHERE id IN (33, 34, 45)
    

    This will return records that have the ID of 33, 34, 45

    0 讨论(0)
提交回复
热议问题