...

View Full Version : Resolved Banner Rotator Display Issue



iAm
09-10-2011, 06: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");
$a=0;
while(list($id,$img,$title,$info,$link)=mysql_fetch_row($rotator)){
$max_length = 70;
if (strlen($title) > $max_length){
$title = substr($title,0,$max_length);
$title .= "..."; }
$imageid[$a]=$id;
$imagesrc[$a]=$img;
$imagetitle[$a]=$title;
$imageinfo[$a]=$info;
$imagelink[$a]=$link;
$a++;
}

iAm
09-10-2011, 06: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.

myfayt
09-10-2011, 06: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.

iAm
09-10-2011, 06: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

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum