We use a registration form, made with Chronoforms v5. Applicants can enroll the form and we keep the results in our database. So far so good. Now, every form should have an unique number. Therefore we try to use the auto_increment field (ID) of the table from the database.
We don’t know how to import this ID in our form.
We use this php-code in a custom field of the form but no number appears:
<?php
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select('id');
$query->from($db->quoteName('aaa_datatable_SchoolAppFormXI'));
$query->where($db->quoteName('id')." = ".$db->quote($value));
$db->setQuery($query);
$result = $db->loadResult();
?>
Can someone give us advice about this?
We don’t know how to import this ID in our form.
We use this php-code in a custom field of the form but no number appears:
<?php
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select('id');
$query->from($db->quoteName('aaa_datatable_SchoolAppFormXI'));
$query->where($db->quoteName('id')." = ".$db->quote($value));
$db->setQuery($query);
$result = $db->loadResult();
?>
Can someone give us advice about this?