...

View Full Version : Help where to start....



DJDex
12-24-2007, 09:24 AM
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.

SeeIT Solutions
12-24-2007, 09:35 AM
the query you want it


$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...

DJDex
12-24-2007, 09:47 AM
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

SeeIT Solutions
12-24-2007, 10:29 AM
That's correct. Also, I noticed a character missing from the first line of code I posted above. Use this instead.


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

DJDex
12-24-2007, 10:50 AM
excellent, that worked out great. Now to piece the rest of this together.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum