The following code displays nothing
but this one does:
Can someone tell me what is wrong?
Thank you!
<?php
$db = JFactory::getDBO();
$query = "SELECT naam, datum, cf_id FROM `jos_feesten` WHERE 1";
$db->setQuery($query);
$rows = $db->loadObjectList();
echo $db->getErrorMsg();
?>
<select id="feest_id" name="feest_id">
<?php
foreach($rows AS $row) {
echo '<option value="'.$row->cf_id.'">'.$row->naam $row->datum.'</option>';
}
?>
</select>
but this one does:
<?php
$db = JFactory::getDBO();
$query = "SELECT naam, datum, cf_id FROM `jos_feesten` WHERE 1";
$db->setQuery($query);
$rows = $db->loadObjectList();
echo $db->getErrorMsg();
foreach($rows AS $row) {
echo "$row->naam, $row->datum" ;
}
?>
Can someone tell me what is wrong?
Thank you!
$row->naam $row->datum
should be
$row->naam.$row->datum
Cheers
Max
Hi tnijman,
. . . or
Good catch Max!!
Bob
. . . or
$row->naam.' '.$row->datum
if you want a space between them.Good catch Max!!
Bob
Thanks 😀
This topic is locked and no more replies can be posted.