I need to do a query like:
UPDATE screening
SET maileddate = NOW(),
reference = '{$reference[$user_id]}'
WHERE user_id IN(....)
And I want to do the judgement, when reference[$user_id] is empty, reference[$user_id] = NULL. My code is :
if(empty($reference[$user_id]) || $reference[$user_id] == ''){
$reference[$user_id] = NULL;
}
But when I execute the query, if $reference[$user_id] is empty, the value of reference in database is empty but not null. What should I do to make it null? thanks