View Full Version : Flash widget database
ruok?
June 19th, 2008, 12:43 AM
What tables and fields in a database would you suggest I create for a flash widget that stores the user's personal music playlists in XML files? :puzzled:
Thanks,
PHP Noob
ahmednuaman
June 19th, 2008, 08:52 AM
User-Playlist table: User Id, Playlist Id, Track Id
Track table: Track Id, Track Name, Track Location
Playlist table: User Id, Playlist Id, Playlist Name
ruok?
June 21st, 2008, 11:59 AM
Thanks for the response.
ahmednuaman, Can you explain why you chose those tables and fields?
Essentially:
I have a flash music player I developed.
It uses an XML file for song info.
I've created a simple php login system
I found code to add form contents to an XML file directly
Now I need to associate that XML file with the logged in user
Thanks for you helpful insight
I'm so close to my goal!
ahmednuaman
June 21st, 2008, 12:03 PM
Well simply put, it just makes sense. For example, by having one table for all the users' details, another for all track details and another for playlists; connecting them up will become a doddle by creating another table that houses the relationship between the user and the playlist, and the playlist and the track(s). It also means that further down the line, you can extend the track/playlist/user table without interfering with your code or the referencing table(s).
ruok?
June 21st, 2008, 06:52 PM
I've set up those tables now.
So would the user id in the playlist table, the user id in the user_playlist table, and the track id in the track table all be the auto-increment column?
Thanks,
PHP Noob
ahmednuaman
June 22nd, 2008, 06:20 AM
No, the user id in the user_playlist table would be relative to the auto-incrementing value of the user id in the user table. So when user 110 comes along, their user id in the user_playlist table is 110. Same with the playlist_track table, although looking back at it now, you don't need user id in that table cos you've got the link between playlist and user in the user_playlist table
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.