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 ?


1 Answer 1


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

// Results in (myfield IS NULL)
// Results in (myfield IS NOT NULL)

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.