简体   繁体   中英

Passing through array and then selecting multiple from database

So I have a table that contains statuses. Each status is shared with a certain username that is shared which is passed through. I want to get all of the groups statuses that a member is joined to. So what I am doing is first getting all of the groups' groupname that the user is a member of. That returns an array and I want to pass that through to a function that returns all statuses from multiple groups. I have to bind the values and don't know how to? Could I put a foreach in the SQL statement? I don't have enough ? for the binding.

STOP!

Use a join. You should never have nested loops of queries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM