In chronoconnectivity v4 was possible to use SQL functions and comparison operators <>! or etc. To construct complex queries
This is an example of code used
(((MONTH (dates) = MONTH (now ()) AND YEAR (dates) = YEAR (now ()) AND enddates = '0000-00-00 ') OR (MONTH (now ()) BETWEEN MONTH (dates) AND MONTH (enddates) AND YEAR (now ()) BETWEEN YEAR (dates) AND YEAR (enddates))))
How can I do this with version 5
This is an example of code used
(((MONTH (dates) = MONTH (now ()) AND YEAR (dates) = YEAR (now ()) AND enddates = '0000-00-00 ') OR (MONTH (now ()) BETWEEN MONTH (dates) AND MONTH (enddates) AND YEAR (now ()) BETWEEN YEAR (dates) AND YEAR (enddates))))
How can I do this with version 5
Hi Vales,
Please try this, you must have the last version:
Pay attention to the quotes, no values will be escaped in this string since it starts with ":", so any user entered values must be escaped.
You can escape values using this:
Regards,
Max
Please try this, you must have the last version:
<?php
return array(":(((MONTH (dates) = MONTH (now ()) AND YEAR (dates) = YEAR (now ()) AND enddates = '0000-00-00 ') OR (MONTH (now ()) BETWEEN MONTH (dates) AND MONTH (enddates) AND YEAR (now ()) BETWEEN YEAR (dates) AND YEAR (enddates))))");
?>
Pay attention to the quotes, no values will be escaped in this string since it starts with ":", so any user entered values must be escaped.
You can escape values using this:
\GCore\Models\MODEL_ID::getInstance()->dbo->quote("value here");
Regards,
Max
I did some basic tests.
With the new method it is necessary to use the model to define the fields
eg. model = test
This are ok.
I did not understand the use of the other method
With the new method it is necessary to use the model to define the fields
eg. model = test
return array (":test.id>". JRequest :: getvar ('rec','', 'get'));
return array (":test.id prova.id = 2 or test.id = 3");
This are ok.
I did not understand the use of the other method
\GCore\Models\MODEL_ID::getInstance()->dbo->quote("value here");
This topic is locked and no more replies can be posted.