View Full Version : Resolved Banner Rotator Display Issue

09-10-2011, 07:37 PM
SOLVEDThis is the code for banner on home page.. Its in random order now, can some one provide me with solutions to change it from being random? Please help me.

$timeoutseconds = 300;
$timestamp = time();
$timeout = $timestamp-$timeoutseconds;

$rotator=mysql_query("SELECT id,img,title,info,link FROM rotator ORDER BY RAND() LIMIT 0,4");
$max_length = 70;
if (strlen($title) > $max_length){
$title = substr($title,0,$max_length);
$title .= "..."; }

09-10-2011, 07:39 PM
I know if I remove the
order by Rand () It displays everything in the opposite order I wish it to work. If some1 can even provide a list of display commands that would help too. Thank You.

09-10-2011, 07:47 PM
Please don't double post. To have it ordered by a certain field you'd do this.

$rotator=mysql_query("SELECT id,img,title,info,link FROM rotator ORDER BY id DESC");

That will make it in order from ID 1 to ID 999 or whatever your last record is.

09-10-2011, 07:48 PM
And I apologize for asking such a simple question, but i am still learning, and I searched all over google. Thats how I landed on this website. So, can some1 please help me? PLEASE

09-10-2011, 07:59 PM
I already posted what you need above.

09-10-2011, 08:15 PM
o wow thank you very much... I wont double post again. Thank You, thank you, this means the world to me :)