How do I create an UpdateAll query with 2 conditions?
Currently my code is
Entries::updateAll(['hello' => 1], ['like', 'registration_ip', $registration_ip]);
I want to add another condition to the end.
How do I write this?
How do I create an UpdateAll query with 2 conditions?
Currently my code is
Entries::updateAll(['hello' => 1], ['like', 'registration_ip', $registration_ip]);
I want to add another condition to the end.
How do I write this?
Entries::updateAll(['hello' => 1], ['and', ['second_condition' => 'value of second condition' ], ['like', 'registration_ip', $registration_ip] ]);
Do not use like for ip as it can give false positive ,use equal, unless you want that it work like the following
21.100.50.2 will match any n21.100.50.2nn ip