Forum Moderators: coopster
the code :
global $database;
$query= "SELECT * FROM #__ew_cover WHERE active = 1";
$database->setQuery( $query );
$rows = $database->loadObjectList();
if ($database->getErrorNum()) {
echo $database->stderr();
return false;
}
$count = count( $rows );
$randItems = array_rand($rows, count($rows));
$row = &$rows[$randItems[0]];
$dtext = html_entity_decode($row->text);
$row2 = &$rows[$randItems[1]];
$row2->id = $row2->cid;
$dname= $row->name;
$dname2= $row2->name;
$dtext2= html_entity_decode($row2->text);
echo "<table width=100%><tr></tr><tr>";
echo "<tr><th width=45% valign=top>$dname:</th><th width=45% valign=top>$dname2:</th></tr>";
echo "<tr><td valign=top><img src=\"$dtext\"></td><td valign=top><img src=\"dtext2\"></td></tr>";
echo "<tr></tr><tr></tr></table>";
For some reason it shows the images just in 1 column,while it should do that in 2 columns.
The title shows ok, seperated left and right (2 column)...
As you see also,the code is based on random image,but i dont wanna use it anymore.
so what i want is that the results of the simple query shows the results in a 2 column table.
Can anyone help me to get this working..
Thank you..