i would like ask you if exist a command that do the opposite of WHERE IN, i want select all the row with different pamaters of an array.
<?php
$data = array(1,2,3);
// normal query
$query = "SELECT * FROM table_1 WHERE id <> 1 && id <> 2 && id <> 3";
// how can i do the same query passing an array?
?>
You can always use NOT before any validation in SQL to get the opposite of it.
In your case it would be:
SELECT *
FROM table_1
WHERE id NOT IN (1,2,3);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With