3

I want to use db_update with condition that a specify field is null ,how can I do it?

something like

->condition('used_date',  'isnull','=') 

is this correct ,if not,what is the correct condition ?

0

1 Answer 1

4

As per documentation, there is a method just for that: ->isNull()

$query->isNull('myfield');
// Results in (myfield IS NULL)
$query->isNotNull('myfield');
// Results in (myfield IS NOT NULL)
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.