How to display data from DB, except for certain?

Hello! Need to get 4 records from the database in descending order, except for 2.
I.e. get the data in the parameters in descending order. And if they 2 are not needed, they miss and instead of them to others, which matches the parameters.
I tried this:
$query = mysqli_query($db, "SELECT `name` FROM `users` WHERE `name` NOT IN (user_1, user_2) ORDER BY `balance` DESC, `id` DESC LIMIT 0, 4");

But finds nothing.
April 3rd 20 at 18:55
1 answer
April 3rd 20 at 18:57
Solution
If user_1 and user_2 is a name field, then why are they not quoted? The query you tried to run manually by connecting to the database client? The error should throw the idea.
Yes, tried it, no errors, just empty - jonatan_Hartmann commented on April 3rd 20 at 19:00
So tried?

$query = mysqli_query($db, "SELECT `name` FROM `users` WHERE `name` NOT IN ('user_1', 'user_2') ORDER BY `balance` DESC, `id` DESC LIMIT 0, 4");
- Vickie commented on April 3rd 20 at 19:03
@Vickie, Worked! Thank you very much! - jonatan_Hartmann commented on April 3rd 20 at 19:06

Find more questions by tags PHPMySQL