DMXzone Database Updater PHP Support Product Page

Solved

Set value to Default NULL

Reported 7 years ago
1
has this problem
7 years ago David Woolley posted:
I notice the Updater is inserting an empty string rather than a NULL value when a non-required field does not have any input.
I've set up all these fields to default NULL in phpMyAdmin.
This happens with the Insert and Update actions - I tried putting a condition on one of these fields:

{{$_POST.presentation!==null}}

But this does not work.
BTW the Server Data Formatter does not have an option to deal with NULL values as far as I cac see.
Maybe it is the General > Default To option?

Any suggestions?

Replies

Replied 7 years ago
7 years ago Teodor Kuduschiev replied:
Hello David,
In insert/Update record step, just use the same expression as you are using to insert also in the condition.
So, if you are inserting: {{$_POST.presentation}} use the same {{$_POST.presentation}} in the condition field below.

If you want to set the default to null, use the general > defaul format: {{$_POST.presentation.default(null)}} as an insert value, then no need to use the condition.
Replied 7 years ago
7 years ago David Woolley replied:
Sorted! So easy.
Thanks Teodor

Reply to this topic