user1475632
user1475632

Reputation: 196

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.

Upvotes: 1

Views: 48

Answers (1)

Jessica
Jessica

Reputation: 7005

STOP!

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

Upvotes: 3

Related Questions