how do i run a query for a variable with multiple values? i've been told a loop is not the right way to do it, which is the way i've been doing it and it has worked. I assumed putting it in a foreach loop would accomplish looping the query for variable with multiple values. e.g. testa and testb are both in the array, $key. foreach($key as $value) { //mysql query } How do i run a single query not in a loop that will have both 'testa' and 'testb' in the WHERE clause?
Why not use AND/OR etc to extend the query performance. I think this will run faster and reduce the looping.
Not entirely sure on how you are needing to query but you can use an IN clause. SELECT columns FROM my_table WHERE column IN ('variable_1','variable_2',etc...);