Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

closed How to preserve NULL value with q2a queries?

0 votes
50 views
asked Dec 21, 2017 in Q2A Core by q2apro
closed Dec 21, 2017 by q2apro

As far as I can see, this query:

qa_db_query_sub('UPDATE `qa_users` SET '.$field.' = $ WHERE userid = # ',
$value, $userid);

insert a string for $field when the passed $value is NULL.

How can I force the NULLing of the field?

----

Update: 

Seems that I had a trim($value) somewhere that made the NULL an empty string. 

So NULL is set in the DB using the query above!

Q2A version: 1.8
closed with the note: done
...