Is it possible to make a query with data from an array in PHP on multiple columns in a database?
Example:
SELECT * FROM rooms WHERE Facility1,Facility2,Facility3,Facility4,Facility5,Facility6,Facility7,Facility8,Facility9 = ' { Array Values Here } '
I have list of checkbox values stored in an array and I only want to select these. If it is not possible, how else can I run a query to select these?
Sure it is possible to query multiple fields:
That’s standard SQL, you find it documented in the mysql manual as well:
SelectSyntaxFor your specific problem (checkbox array values) it heavily depends. You need to map the checkbox array values to the fields in the mysql database to create an SQL statement that makes sense.
As you have not given any information next to that it’s an array, there is not much to give as an example but that you map these array values to database columns.