Hi, i'm Claudio
i have a problem with a query inside the form.
My form should do only a count of rows of the table, i have made the form with only header text as element, and i have insert inside the Action -> On Load : Show Html and Custom Code
inside the Custom Code i have insert this code
but when i perform the form it don't work
i don't know if the problem is in the code or my use of chronoforms is not correct
thanks for help
i have a problem with a query inside the form.
My form should do only a count of rows of the table, i have made the form with only header text as element, and i have insert inside the Action -> On Load : Show Html and Custom Code
inside the Custom Code i have insert this code
<?php
$db =& JFactory::getDBO();
$query = "SELECT count(*) FROM jos_broken WHERE cf_modified='0000-00-00 00:00:00'";
$db->setQuery($query);
$db->query();
$num_rows = $db->getNumRows();
$echo($num_rows);
?>
but when i perform the form it don't work
i don't know if the problem is in the code or my use of chronoforms is not correct
thanks for help
Hi Claudio,
Please try:
Bob
Please try:
<?php
$db =& JFactory::getDBO();
$query = "
SELECT COUNT(*)
FROM `#__broken`
WHERE `cf_modified` = '0000-00-00 00:00:00'
";
$db->setQuery($query);
$num_rows = $db->getResult(); // <-- see here
echo $num_rows; // and here (no $ in $echo)
?>
Bob
This topic is locked and no more replies can be posted.