What's new

Welcome to xCrud Community - Data Management and extended PHP CRUD

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

How do do xcrud->where NOT IN

ben74

New member
Joined
Dec 13, 2021
Messages
20
Reaction score
5
Points
3
Location
France
Hello guys,

Is there a workaround to be able to run "NOT IN" operator with xcrud->where method?

This for example doesn't work:
Code:
$buyername_not_in_string = "'a','b','c'";
$xcrud->where('buyers.buyer_name NOT IN ', $buyername_not_in_string);

it ends up with: Uncaught mysqli_sql_exception: Unknown column 'buyers.buyer_name NOT IN' in 'where clause'

I can probably transform my NOT IN in a couple != but it's not as elegant...

Thanks for any tip ;-)
 

DaDo

Administrator
Staff member
Joined
Dec 1, 2021
Messages
108
Reaction score
23
Points
18
Sorry for delay too busy you can try using this :


PHP:
$xcrud->where("buyers.buyer_name NOT IN $buyername_not_in_string");
 
Top Bottom