Welcome to WebmasterWorld Guest from 54.198.179.85

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Changing query result random

     
9:58 pm on Oct 16, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 3, 2005
posts: 187
votes: 0


hi , thought it would be better to start new topic for this..
The below works perfect now (look other topic)..but i wanna get rid of the random and that it shows all instead....cause now it only shows an image left and right...nothing more...
How do i do that?

global $database;
$query= "SELECT * FROM #__ew_wops 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);

6:33 am on Oct 17, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 15, 2004
posts:1867
votes: 0


This code looks like it is a joomla code.

You could have just edited the random function and edit the rest accordingly, but I don't think that is going to be perfect that way.

This question can be posted at the Joomla Forum, and you might get a better response there.