Where conditions IS NULL

anienebiketeam 03 Mar, 2017
Hi,
I need to do this where condition:
WHERE model.field IS NULL


I have tested this code on the "Where conditions" section:
model.field/is:NULL

but this doesn't work because in the script put NULL value between two apexes (i.e. 'NULL') as in the following code:
wrong mysql condition: WHERE model.field IS 'NULL'


Someone could help me please?

Thanks
Francesco
Max_admin 03 Mar, 2017
Hi Francesco,

Please try:
model.field/is

Or
model.field/is:{value:null}


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
anienebiketeam 03 Mar, 2017
They don't work. I have this error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' AND `ISCR`.`id_user` IS ''' at line 1 SQL=SELECT COUNT(`USRS`.`id`) AS `USRS.count` FROM `#__users` AS `USRS` LEFT JOIN `#__chronoforms_iscrizione_gara` AS `ISCR` ON `USRS`.`id` = `ISCR`.`id_user` WHERE `ISCR`.`id_gara` IS '' AND `ISCR`.`id_user` IS '';

I tested also:
model.field:

This code run but doesn't give back Null fields.

I ran the sql string on phpmyadmin, with the right condition IS NULL and it give me the attended results
Max_admin 04 Mar, 2017
Hi Francesco,

What about the 2nd code block, what error does it return ?

You may try this code in the where conditions:

<?php
return array("Model.field", null, "is");


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
anienebiketeam 05 Mar, 2017
Hi Max,

the code
model.field/is:{value:null}

give back this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' AND `ISCR`.`id_user` IS ''' at line 1 SQL=SELECT COUNT(`USRS`.`id`) AS `USRS.count` FROM `#__users` AS `USRS` LEFT JOIN `#__chronoforms_iscrizione_gara` AS `ISCR` ON `USRS`.`id` = `ISCR`.`id_user` WHERE `ISCR`.`id_gara` IS '' AND `ISCR`.`id_user` IS '';

i tested your last code:
<?php
return array("Model.field", null, "is");

but this give me back something as:
WHERE `Model`.`field` = '' AND `Model`.`` = '' AND `Model`.`is` = '';
so CCv6 read the 3 parameters of return array as fields of db table.

CCv6 seem to insert always the parameter between two apexes and the last format of return array is wrong.

Thanks again
Francesco
Max_admin 05 Mar, 2017
Hi Francesco,

Ok, the last code I posted has a small problem, please test this one:

<?php
return [["Model.field", null, "is"]];


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
anienebiketeam 05 Mar, 2017
Hi Max,
also with this code I have always the same error about the apexes:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' AND `ISCR`.`id_user` IS ''' at line 1 SQL=SELECT COUNT(`USRS`.`id`) AS `USRS.count` FROM `#__users` AS `USRS` LEFT JOIN `#__chronoforms_iscrizione_gara` AS `ISCR` ON `USRS`.`id` = `ISCR`.`id_user` WHERE `ISCR`.`id_gara` IS '' AND `ISCR`.`id_user` IS '';

I have always back
WHERE model.field IS ''
but i need of
 WHERE model.field IS NULL
.

Could be a bug?

thanks
Francesco
Max_admin 06 Mar, 2017
Answer
Hi Francesco,

Yes, i have just found a small glitch in the code which may be causing this, please send me a message using the "contact us" page to get a patch file.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
anienebiketeam 06 Mar, 2017
1 Likes
With the patch file and this code in where condition section work perfectly!
model.field/is:{value:null}


thx
Francesco
This topic is locked and no more replies can be posted.