Help needed on time calculation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • walrama
    New Member
    • Jul 2007
    • 2

    Help needed on time calculation

    Hello,

    I have to write a small script which allows users to select individual tracks from a music album.
    Each track has a checkbox next to its title (to allow for multiple selections).
    Each title also mentions the duration of the track.

    I have to pass the values of the selected tracks to the next page and this second page should display the total duration of all selected tracks (as well as the individual titles and durations).

    As I am definitely not a php guru and I am not sure how I can do this properly.

    Is there any existing script that can give me clues?

    Thanks,
    Marc
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    You'll need to familiarize yourself with the way that checkboxes are posted in the $_POST array, date and time manipulation to add the track times together, and you'll need to database all of the tracks individually.

    A good way to organize your tables are to have three tables for the tracks:

    1) One for the artists with an id and the artists' name
    2) One for the albums with an id, the id of the artist that made it, and the album title
    3) One for the actual tracks with an id, the id of the album it's in, the track title, and the track duration

    PHP makes all of what you're after relatively easy (to me, at least), so as long as you keep it organize, you'll be fine.

    Comment

    • walrama
      New Member
      • Jul 2007
      • 2

      #3
      Thanks a lot for your advice.
      I'll try it...

      Marc


      Originally posted by volectricity
      You'll need to familiarize yourself with the way that checkboxes are posted in the $_POST array, date and time manipulation to add the track times together, and you'll need to database all of the tracks individually.

      A good way to organize your tables are to have three tables for the tracks:

      1) One for the artists with an id and the artists' name
      2) One for the albums with an id, the id of the artist that made it, and the album title
      3) One for the actual tracks with an id, the id of the album it's in, the track title, and the track duration

      PHP makes all of what you're after relatively easy (to me, at least), so as long as you keep it organize, you'll be fine.

      Comment

      Working...