DMXzone Database Updater PHP Support Product Page
Solved
Set value to Default NULL
Reported 24 Aug 2017 08:33:56
1
has this problem
24 Aug 2017 08:33:56 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 24 Aug 2017 10:31:13
24 Aug 2017 10:31:13 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.
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 24 Aug 2017 12:10:29
24 Aug 2017 12:10:29 David Woolley replied:
Sorted! So easy.
Thanks Teodor
Thanks Teodor