I have a query with 3 variables that I run over and over. How can I create a query that will accept arrays of values such that I can run the query once and get all the data in one result? Here is an example:
SELECT * FROM table WHERE column 1 = 3 AND column 2 != 35 AND column 3 > 10
SELECT * FROM table WHERE column 1 = 9 AND column 2 != 12 AND column 3 > 293
SELECT * FROM table WHERE column 1 = 6 AND column 2 != 96 AND column 3 > 39
I need the query to execute such that the first values (index 0) of each array get run together, then the second values (index 1) of each array get run together and so on. In other words, I want the query to run using the values [based on above example] (3,35,10) then (9,12,293) and so on.
The query needs to be stand alone meaning I need to be able to pass the 3 arrays via $_POST to a remote server that will get directly plugged into the query and executed on the remote server.
Using IN and NOT IN will not work because those comparison operators do not go in order of array indexes.
Any thoughts would be greatly appreciated. I have tried searching many places for solutions and cannot find anything. This type of query might be called something, so maybe that is why I have found nothing.