I want to be able to get only values where there is a '1' in multiple columns. My column names are stored dynamically in a variable though. How would I go about this?
This is what I have.
Columns are layed out like this
$Columns = "Computer, Science, Algebra, Biology, Networking";
//This is Dynamic so $Columns may be like this next time
$Columns = "Biology, Networking";
$SQL = "SELECT * FROM users WHERE '1' IN(".$Columns.")";
Right now, it selects any users that have a "1" in any of the columns
I only want to retrieve the users that have a "1" in ALL
of the variables in the array $Columns
not just one of them