unable to use mysql & php in marquee js

Discussion in 'PHP' started by ingilizdili, May 17, 2011.

  1. #1
    Hello;
    I am the editor of a small businessman society website. At the top of the page I want to display the member logos. I have assigned logos for each member and these logos appear in marquee order from left to right. When clicked, a new page informing of the related member will be shown.
    There are about 60 members and I want 16 logos randomly selected to be displayed each time the page is refreshed. The path to the logos and other information is stored in database.
    I managed to make it work. However, it often doesn't work and the logos won't be seen.
    What is the problem, do you think?
    Here is the code:
    $result = mysql_query("SELECT * FROM asil_members ORDER BY RAND() LIMIT 16");
    while($row = mysql_fetch_array( $result )) {
    $id = $row['id'];
    $word = $row['word'];
    $logo = $row['logo'];
    
    $firma_adi = $row['firma_adi']
    echo "<a href=\"javascript:poptastic('/_includes/_uye-tekil.php?id=", $id, "');\"><img border='0' alt='", $firma_adi, "' title='", $firma_adi, "' width='100' height='100' src='", $logo, "' /> </a>";
    
    }
    PHP:
    And below this code is the js for the marquee.
    Please help.
     
    ingilizdili, May 17, 2011 IP
  2. anwaraa

    anwaraa Active Member

    Messages:
    167
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    90
    Digital Goods:
    2
    #2
    Try this:

    $result = mysql_query("SELECT * FROM asil_members ORDER BY RAND() LIMIT 16");
    while($row = mysql_fetch_array( $result )) 
    {
    $id = $row['id'];
    $word = $row['word'];
    $logo = $row['logo'];
    $firma_adi = $row['firma_adi'];
    echo "<a href=\"javascript:poptastic('/_includes/_uye-tekil.php?id=".$id."');\"><img border='0' alt='".$firma_adi."' title='".$firma_adi."' width='100' height='100' src='".$logo."' /> </a>";
    }
    Code (markup):
     
    anwaraa, May 18, 2011 IP
  3. ingilizdili

    ingilizdili Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a lot. It seems to work now. But the real problem was, as far as I can see, the fact that some logos were missing as I hadn't had time to design new logos for some of the recent members. Now I have done it and it works, for the moment at least.
     
    ingilizdili, May 18, 2011 IP