Hi, I need to pull in the details of the registrations table into my events.. Basically I need to display all the names that a particular person has registered and give it as options in the drop down menu.. Here's the code I used on the basis of this forum http://www.chronoengine.com/forums.html?cont=posts&f=2&t=11490&p=16600&hilit=get+current+user+id#p16600 and http://www.chronoengine.com/forums.html?cont=posts&f=5&t=12413&st=0&sk=t&sd=a&start=15#p22684..
Here's the code I used..
I have checked and the data seems to registering fine into the jos_chronoforms_registrations table.. in the registrations table, name is the attribute i want in the drop down menu, and cf_user_id is the attribute chronoforms inserts automatically when submitting the form (i.e. the user id of the person submitting the form...) All I get is the drop down menu, with no options in it..
What am I doing wrong here? Please help me out with this...
Thanks🙂
Here's the code I used..
<?php
$db =& JFactory::getDBO();
$user = JFactory::getuser();
$query = "
SELECT name
FROM jos_chronoforms_registrations
WHERE cf_user_id = '".$user->id."'";
$db->setQuery($query);
$rows = $db->loadObjectList();
?>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label">Participant Name</label>
<select class="cf_inputbox validate-selection" id="select_1" size="1" {cf_multiple} name="name_1">
<?php
foreach ($rows as $current) {
echo "<option value='$row'>$current</option>";
}
?>
</select>
</div>
I have checked and the data seems to registering fine into the jos_chronoforms_registrations table.. in the registrations table, name is the attribute i want in the drop down menu, and cf_user_id is the attribute chronoforms inserts automatically when submitting the form (i.e. the user id of the person submitting the form...) All I get is the drop down menu, with no options in it..
What am I doing wrong here? Please help me out with this...
Thanks🙂