Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2011
    Posts
    43
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Display latest mp3s

    I am trying to display the latest mp3 files uploaded by the members on my site, I got the script working for the latest members and their profile pics, but I can't seem to get it working for mp3 files. her is my code:

    PHP Code:
    $sql mysql_query("SELECT id, username, mp3_title, mp3_id  FROM mp3 WHERE mp3_id='mp3_id' ORDER BY mp3_id DESC LIMIT 10");

    while(
    $row mysql_fetch_array($sql)){

        
    $id $row["id"];
        
    $mp3_id $row["mp3_id"];
        
    $mp3_title $row["mp3_title"];
        
    $username $row["username"];
        
    $username substr($username010);
        
        
    $id mysql_real_escape_string($id);
        
    $mp3_id mysql_real_escape_string($mp3_id);
        
    $mp3_title mysql_real_escape_string($mp3_title);
        
    $username mysql_real_escape_string($username);
        
        
    $SongDisplayList .= '<a href="http://www.********.com/profile.php?id=' $id '">' $mp3_title '</a><br>';



    in the html:

    PHP Code:
    <? print  "SongDisplayList" ?>
    Last edited by twinrecords; 06-12-2011 at 08:18 AM. Reason: forgot html line

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    I think, there you need ORDER BY id DESC instead.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    May 2011
    Posts
    43
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I actually got it working, not quite sure what I did that made it work, because it's the exact same code as above, I just retyped it a third time by hand, it wasn't giving me any errors, it just wasn't displaying anything, but it's all good now.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •