I made a registration form and was wondering if it possible to limit the form to only allow the first 20 (or whatever number) registrations, then don't allow any more?
Thanks!!
Thanks!!
<?php
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select all records from the jml_chronoforms_data_wellnessoilsevent table.
$query->select(*);
$query->from('jml_chronoforms_data_wellnessoilsevent');
// Reset the query using our newly populated query object.
$db->setQuery($query);
// Load the results as a list of stdClass objects.
$rows = $db->loadObjectList();
$countrows = count($rows);
?>
<?php
// Get a db connection.
$db = JFactory::getDbo();
$query = "
SELECT COUNT(*)
FROM `jml_chronoforms_data_wellnessoilsevent` ;
";
$db->setQuery($query);
$count = $db->loadResult();
if ( $count > 0 ) {
return 'event_a';
}
?>
if ( $count > 20 ) {
return 'event_a';
}