Web Analytics Made Easy -
StatCounter Banner Rotator Display Issue - CodingForum

Announcement

Collapse
No announcement yet.

Banner Rotator Display Issue

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolved Banner Rotator Display Issue

    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.

    PHP Code:
    $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++;

    Last edited by Inigoesdr; Sep 10, 2011, 03:28 PM.

  • #2
    I know if I remove the
    PHP Code:
    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.

    Comment


    • #3
      Please don't double post. To have it ordered by a certain field you'd do this.

      PHP Code:
      $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.
      Been a sign maker for 8 years. My business:
      American Made Signs

      Comment


      • #4
        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

        Comment


        • #5
          I already posted what you need above.
          Been a sign maker for 8 years. My business:
          American Made Signs

          Comment


          • #6
            o wow thank you very much... I wont double post again. Thank You, thank you, this means the world to me

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎