I have a page that displys song lyrics stored in a database. It's a bit sketchy as I've only spent a few hours on it. I want to display the total time for all tracks in an album. I have the times for each track stored in the database in the time format (00:00:00) and I can access them fine in a while loop. What I don't know how to do is add them together so that 3min21sec + 1min12sec = 4min 33sec.
So far I have this:
while($album_songs = mysql_fetch_row($lyrics_result)) {
$album_len = $album_len + $album_songs[3];
echo "$album_songs[3] - $album_len<br>";
echo "<b>$album_songs[0] - $album_songs[1]</b> - <i>$album_songs[3]</i>".
"<br>\n";
}
echo "$album_songs[3] - $album_len<br>";
this displays the song length in time format but $album_len is always 0.
The page
Is this possible or is there an easy way todo it?
Thanks
~Phily