www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to store selected songs ids in db?

  1. #1
    Join Date
    Mar 2005
    Posts
    208

    Arrow How to store selected songs ids in db?

    Hi all i have a db for my music collection. It has one table with the following feilds on it:

    Code:
    ID|filename|artist|album|title|track|comments|genre|seconds|filesize|bitrate
    I already created pages that with checkboxes that user select indvidual songs and by click of play button it goes and plays those songs for me.

    Now i created another button next to play that it supposed to write the selected songs to db and save the ids of slected songs.Note: i use song ids to pull indvidual songs from db to be played by my song player!

    My problem is i do not how to design a few tables that keep track of selected songs for each user along with the name of playlist for each user!! In processs i do not want to modify my current table i just want to add more tables to help me achive what i want. I be happy if an expert tell me how i can create tables that store play list(selected songs)info for each user and later i be able to query them easily in order to pull out playlist of each user.Thanks

  2. #2
    Join Date
    Apr 2005
    Location
    Bathurst, NSW, Australia
    Posts
    3,357
    Creating a table is quite easy,
    Code:
    CREATE TABLE `tablename` (
    `id` INT NOT NULL AUTO_INCREMENT ,
    `username` VARCHAR( 12 ) NOT NULL ,
    /* further fields to be added */
    PRIMARY KEY ( `id` )
    ) TYPE = MYISAM ;
    What I recommend is that you install phpMyAdmin onto your server. It makes viewing and modifying your SQL database sooo much easier. Make sure that you place it in a protected directory though (.htaccess)!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles