I am trying to get all the data from a table on which i have 2 specific columns ( width and height) + other data, and i also need to filter them using an array of data that i have inside the app. My inside array looks like this, but with multiple entries :
$presetSize = Array (
[0] => Array
(
[width] => 336
[height] => 280
)
[1] => Array
(
[width] => 300
[height] => 250
)
.
.
.
)
The thing I am trying to do is to get all the data from the DB where the width and height are not found inside the array, which in my case represent custom sizes.
In mysql “Where not in using two columns” using two columns I can read how to accomplish that using the form select when you extract data from another table, but here i have an array with arrays that sends an error when i try it.
I tried:
SELECT * FROM items WHERE type = 1 AND (width, height) NOT IN (" . $presetSize . ");
and it returns
MySQL Error: Unknown column 'Array' in 'where clause'
Hope the question is clear enough.