How can I put in GC the following where statement:
status = ‘Active’ or status is null?
How can I put in GC the following where statement:
status = ‘Active’ or status is null?
Hello @GabrielD ,
Yes it is possible to have that. The trick here is to use the string as a value and the parenthesis. So more specifically for your example you should use:
$crud->where("(status='Active' OR status IS NULL)");
The parenthesis is very important or else you will have issues with the quick filters.
Hope it helped.
Regards
Johnny
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| [RESOLVED] Error in “validate.php” in the “_get_language_mapping()” function |
|
10 | 1.9k | Mar 31 |
| [RESOLVED] Updated Grocery CRUD Enterprise from 3.2.4 to 3.2.7 |
|
1 | 842 | Jan 14 |
| Custom validation functions |
|
0 | 727 | Jan 22 |
| Function fieldType with parameter ‘multiselect_searchable’. and groupFields |
|
1 | 543 | Apr 9 |
| setRule - Validate doesn’t support more than 3 parameters |
|
0 | 603 | Feb 23 |