blue-mouse
Member
I need condition:
But works correctly only this piece:
what to do with:
WHERE `form_id`='20' AND `data_zast_od1`<= NOW() AND `data_zast_do1`>=NOW()
?
PHP:
$db =& JFactory::getDBO();
$recipient1 = '{ccjom_cc_zapotrzebowanie___recipient1_raw}';
var_dump($recipient1);
$query2 = "SELECT COUNT(`email_zastep`) AS tot FROM
`ccjom_cc_lista_zastepstw` WHERE `form_id`='20' AND `status_zastepstwa1`='TAK'
AND `data_zast_od1`<= NOW() AND `data_zast_do1`>=NOW() AND `osoba_zastepowana` = " . $db->Quote($recipient1);
$db->setQuery($query2);
$result2 = $db->loadResult();
return $result2 == 0;
But works correctly only this piece:
PHP:
$db =& JFactory::getDBO();
$recipient1 = '{ccjom_cc_zapotrzebowanie___recipient1_raw}';
var_dump($recipient1);
$query2 = "SELECT COUNT(`email_zastep`) AS tot FROM
`ccjom_cc_lista_zastepstw` WHERE `status_zastepstwa1`='TAK'
AND `osoba_zastepowana` = " . $db->Quote($recipient1);
$db->setQuery($query2);
$result2 = $db->loadResult();
return $result2 == 0;
what to do with:
WHERE `form_id`='20' AND `data_zast_od1`<= NOW() AND `data_zast_do1`>=NOW()
?