Hi,
I have been trying to populate an option box from database using some code I found in the forum but cannot get it to work, I keep getting error unexpected ; in line 6
The mysql database is jos_chronoforms_data_enterGifts I want to populate an option box with the column data gift_description about 35 rows in total.
Any help would be appreciated
Irvin Metcalf
I have been trying to populate an option box from database using some code I found in the forum but cannot get it to work, I keep getting error unexpected ; in line 6
The mysql database is jos_chronoforms_data_enterGifts I want to populate an option box with the column data gift_description about 35 rows in total.
Any help would be appreciated
Irvin Metcalf
<?php
$db =& JFactory::getDBO();
$query = 'SELECT * FROM ' . $db->gift_description('#__chronofroms_data_enterGifts');
$db->setQuery($query);
if ($gift_description =& $db->loadObjectList();) {
echo "<select name="gift_description">";
foreach ($descriptions as $gift_description) {
echo "<option value='" . $gift_description->descriptions . "'></option>";
}
echo "</select>";
} else {
echo "No Gifts Available";
}
?>