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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help where to start....

    Ok, so i'm trying to create this kinda product type thing. Basically its a artist database for indie labels. The artist can log in and change there BIO, there myspace links, soundclick links, upload cd images and mp3s. I already have it where its pulling the bio from a mysql database and the cd images from a folder. So currently I am working on the mp3 part. Currently I just don't know where to start. So far I have setup these fields in a table called mp3info.

    user_id
    mp3_artist
    mp3_trackname
    mp3_cd
    mp3_year
    mp3_lyrics
    mp3_mp3name

    What I would like to do is eventually I will create a backend page to add to the database and upload the mp3s. My current goal right now however is to have my PHP file pull the information based on the user_id. I guess loop and pull anything that matches the user_id and put it into a table. The user id I guess I will be having pulled via the URL I haven't gotten that far yet. Should I put this into place right now if so what would be the best way to go about it.

    I know coding pretty good and I have gotten this far. I however have not taken on such a big project yet. I created the project because I have started a record label with a friend of mine and we looked for something like this already and didn't find anything so I decided to make one. Any and all help is greatly appreciated. Thanks again.
    Last edited by DJDex; 12-24-2007 at 09:30 AM.

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    563
    Thanks
    0
    Thanked 3 Times in 3 Posts
    the query you want it

    PHP Code:
    $result mysql_query("SELECT * FROM `table` WHERE `user_id` = '".addslashes($_GET['user_id']."'");
    if (
    mysql_num_rows($result) > 0) {
      echo 
    '<table>';
      while (
    $row mysql_fetch_assoc($result)) {
        echo 
    '<tr>';
        echo 
    '<td>'.$row['mp3_artist'].'</td>';
        echo 
    '<td>'.$row['mp3_trackname'].'</td>';
        echo 
    '<td>'.$row['mp3_cd'].'</td>';
        echo 
    '<td>'.$row['mp3_year'].'</td>';
        echo 
    '<td>'.$row['mp3_lyrics'].'</td>';
        echo 
    '<td>'.$row['mp3_mp3name'].'</td>';
        echo 
    '</tr>';
      }
      echo 
    '</table>';

    That will get your the information you want and put it in a table...

  • #3
    New Coder
    Join Date
    Jan 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok so the lyrics one I was thinking of maybe making it a link to a pop up window but I'm not gonna do that for right now. however, now how do I put the user id in the url?

    Would I do something like when someone clicks a link it will be deathentertainment.com/artist.php?userid=1

  • #4
    Regular Coder
    Join Date
    May 2005
    Posts
    563
    Thanks
    0
    Thanked 3 Times in 3 Posts
    That's correct. Also, I noticed a character missing from the first line of code I posted above. Use this instead.

    PHP Code:
    $result mysql_query("SELECT * FROM `table` WHERE `user_id` = '".addslashes($_GET['user_id'])."'"); 

  • #5
    New Coder
    Join Date
    Jan 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    excellent, that worked out great. Now to piece the rest of this together.


  •  

    Posting Permissions

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