Buy Now
Sign in

php and event switcher does not work properly

samir1903 , February 23 at 14:27
S
samir1903 166
February 23 at 14:27 #384122
this new version bugs bugs and bugs
php16
$app =& JFactory::getApplication();
$db =& JFactory::getDBO();
$query = "
SELECT COUNT(*)
FROM `os5pk_chronoforms_data_xxxx`
WHERE `no_DI` = '{$this->data['no_DI']}' or `correo` = '{$this->data['correo']}';
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count > 0 ) {
return 'registered_ID';
} else {
return 'look_codigo';
}
event swither data provider
{var:php16}
switches
registered_ID and look_codigo
this php return in debug always look codigo
i wanted to upload images here but i think there is a bug in forum as well i couldnt upload
admin 27.0
February 23 at 15:51 #384126
Hi samir,
Please test with the new update ?
Also you can modify your code to do a quick test, use this:
pr($count);
to check the count value directly!
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
S
samir1903 166
February 23 at 17:58 #384130
 Answer
right new version looks better
before ,it returned 0 therefore event switcher worked correct
however problem was in php

it appearded "and parameter" instead of "or parameter", even i am sure i put "or", this where i copied and pasted to the forum.
now changed and to or, it returned 1
so bug is gone
thanks