Jump to content

help playing stearming audio with dw,php,mysql


Recommended Posts

Can someone point me in the right direction? I am using Dreamweaver MX 2004 and need help with a dynamic site. I am using mysql and PHP through Dreamweaver.

I have a record store selling on artist’s albums.

 

 

The album.php page shows all the albums and allows you to select which album you want to see detail. The albumID is passed to the album_detail.php page. This page has album descriptions, price, etc. It also list the songs In the album. This all works. I want the viewer to click on the sing name and it will play a sample of the songs. That’s where I am having a problem. See below.

 

 

I have a database with a table album and song. Following is the database sql. on.

 

/*

SQLyog Enterprise v4.0

Host - localhost : Database - isaiahrecords

**************************************************************

Server version 4.0.0-alpha-nt

*/

 

create database if not exists `isaiahrecords`;

 

use `isaiahrecords`;

 

/*

Table structure for album

*/

 

drop table if exists `album`;

CREATE TABLE `album` (

`albumID` int(11) NOT NULL auto_increment,

`album_name` varchar(70) default NULL,

`album_description` text,

`album_price` varchar(7) default NULL,

`album_cover` varchar(100) default NULL,

`album_coverthumbnailURL` varchar(100) default NULL,

`album_special` char(3) default NULL,

`album_buy` varchar(255) default NULL,

PRIMARY KEY (`albumID`)

) TYPE=MyISAM;

 

/*

Table data for isaiahrecords.album

*/

 

INSERT INTO `album` VALUES

(1,'Ask','This cd is dedicated to the many children of God who are smooth jazz lovers. The project is a presentation of familiar jazz tunes that have been remixed, rewritten and crossed over to portray a version that expresses the life of Christ and timelessness of His Word. Get ready jazz lovers, this one will keep you with your finger on the repeat button. The Jazz Project , created for your listening pleasure. Enjoy it with all of your friends.','15','Albumcovers/ask.jpg','Thumbnails/ask_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=Ask Album CD&price=15.00&units=1&return=isaiahrecords.com'),

(2,'Crossing Over','This cd is dedicated to the many children of God who are smooth jazz lovers. The project is a presentation of familiar jazz tunes that have been remixed, rewritten and crossed over to portray a version that expresses the life of Christ and timelessness of His Word. \n\nGet ready jazz lovers, this one will keep you with your finger on the repeat button. The Jazz Project - created for your listening pleasure. Enjoy it with all of your friends.','15','Albumcovers/jass.jpg','Thumbnails/jass_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=The Jazz Project Album&price=15.00&units=1&return=isaiahrecords.com'),

(3,'One More Night with The Frogs','One More Night With The Frogs - Presenting new album from Arthur. It is an uplifting mixture of smooth jazz and some originals from Arthur that will truly bless your soul. And of course, there is \"The Frog!\".','15','Albumcovers/frog.jpg','Thumbnails/frog_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=One MoreI Night With The Frogs&price=15.00&units=1&return=isaiahrecords.com'),

(4,'Making Music I - Authur & Family','Arthur and Family Vol. 1 offers an assortment of Arthur’s most requested concert selections like “I’ll Tell It” and “Center Of My Joy.” This project includes a captivating background vocal mix featuring some of the most gifted vocalist from Arthur’s church family. Listen to the debut of Arthur’s daughter Alex as she sings lead on the crossover and remix of the song “Missing You” which also includes a special debut of the poetic voice of her mother Jill. The songs on Family Vol. 1 are prepared and selected for the enjoyment of the whole family! ','15','Albumcovers/mm1.jpg','Thumbnails/mm1_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=Making Music II II Album&price=15.00&units=1&return=isaiahrecords.com'),

(5,'Making Music II - Authur & Family','Arthur and Family Vol. 2 presents a “live” concert performance where Arthur is joined by friends who present a variety of musical styles and talents. The background vocalists from Vol. 1 are out front singing inspirational songs of worship and praise. Listen for yourself and experience praise and worship in an atmosphere filled with joy and excitement. Join in and sing along to some of your favorite tunes!','15','Albumcovers/mmII.jpg','Thumbnails/mmII_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=Family Album CD&price=15.00&units=1&return=isaiahrecords.com'),

(6,'Christms Joy','Christmas Joy Enjoy your holiday season with Arthur and the Northside Baptist Celebration Choir, singing a selection of favorite Christmas songs. Prepare to clap and sing along as Arthur and the Sarasota Baptist Church Choir sing their special rendition of “I Have Seen the Light” and “Go Tell It On The Mountain.” Reminisce on Christmases past while listening to medleys of popular Christmas classics, which include \"Chestnuts Roasting On An Open Fire.” Christmas Joy is a CD that you’ll want to listen to all year round! \n\n','15','Albumcovers/christmasjoy.jpg','Thumbnails/christmasjoy_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260_\"uct=Christian Joy CD&price=15.00&units=1&return=isaiahrecords.com');

 

/*

Table structure for albumkey

*/

 

drop table if exists `albumkey`;

CREATE TABLE `albumkey` (

`albumkeyID` int(11) NOT NULL auto_increment,

`albumID` int(11) default NULL,

`songsID` int(11) default NULL,

PRIMARY KEY (`albumkeyID`)

) TYPE=MyISAM;

 

/*

Table data for isaiahrecords.albumkey

*/

 

INSERT INTO `albumkey` VALUES

(1,1,1),

(2,1,2),

(3,2,3),

(4,2,4),

(5,3,5),

(6,3,6),

(7,4,7),

(8,4,8),

(9,5,9),

(10,5,10),

(11,6,11),

(12,6,12);

 

/*

Table structure for songs

*/

 

drop table if exists `songs`;

CREATE TABLE `songs` (

`songsID` int(11) NOT NULL auto_increment,

`song_name` varchar(50) default NULL,

`song_file` varchar(100) default NULL,

`song_time` varchar(10) default NULL,

PRIMARY KEY (`songsID`)

) TYPE=MyISAM;

 

/*

Table data for isaiahrecords.songs

*/

 

INSERT INTO `songs` VALUES

(1,'Ask','http://isaiahrecords.com/Music/Ask/Ask.ram','3'),

(2,'Are you sure','http://isaiahrecords.com/Music/Ask/Are you sure.ram','3'),

(3,'In The Beginning','http://iasishrecords/Music/Jass_Project/IN_THE_BEGINNING.RAM','3'),

(4,'Moomba','http://isaiahrecords/Music/Jass_Project/MOOMBA.RAM','3'),

(5,'Frog','http://isaiahrecords/Music/One_More_Night_With_The_Frogs/Frog.ram','3'),

(6,'Good Fruit','http://isaiahrecords/Music/One_More_Night_With_The_Frogs/Good_Fruit.ram','3'),

(7,'You Bring Me Up','http://isaiahrecords/Music/MMV1/Bring me up.ram','3'),

(8,'Jesus Loves Me','http://isaiahrecords/Music/MMV1/Jesus Loves me.ram','3'),

(9,'O Happy Day','http://isaiahrecords/Music/MMV2/O Happy day.ram','3'),

(10,'People Get Ready','http://isaiahrecords/Music/MMV2/People get ready.ram','3'),

(11,'A King Is Born','http://isaiahrecords/Music/Christmas_Joy/KING IS BORN.RAM','3'),

(12,'Amen','http://isaiahrecords/Music/Music/Christmas_Joy/AMEN.RAM','3');

 

 

The pages are album.php and album_detail.php. The album.php feeds the album_detail.php with the albumID.

 

The recordset rs_album_detail is as follows:

SELECT album.albumID,album.album_cover,album. album_name, album.album_description, album.album_price, album.album_buy, songs.song_name, songs. song_time, songs.song_file

FROM album, albumkey, songs

WHERE album.albumID = albumkey.albumID AND songs.songsID = albumkey.songsID AND album.albumID = colname

 

The variables box I have :

Name =Colname Value =1, and runtime=$HTTP_GET_VARS['albumID']

 

Code: <?php

$colname_rs_album_detail = "1";

if (isset($HTTP_GET_VARS['albumID'])) {

$colname_rs_album_detail = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['albumID'] : addslashes($HTTP_GET_VARS['albumID']);

}

mysql_select_db($database_cn_isaiahrecords, $cn_isaiahrecords);

$query_rs_album_detail = sprintf("SELECT album.albumID,album.album_cover,album. album_name, album.album_description, album.album_price, album.album_buy, songs.song_name, songs. song_time, songs.song_file FROM album, albumkey, songs WHERE album.albumID = albumkey.albumID AND songs.songsID = albumkey.songsID AND album.albumID = %s", $colname_rs_album_detail);

$rs_album_detail = mysql_query($query_rs_album_detail, $cn_isaiahrecords) or die(mysql_error());

$row_rs_album_detail = mysql_fetch_assoc($rs_album_detail);

$totalRows_rs_album_detail = mysql_num_rows($rs_album_detail);

?>

I am trying to play a audio stream from the songs table: I dragged The {rs_album_detail.song_name} from the recordset and went to the link box in properties, clicked on datasource and selected song_file from the record set. It is not selecting the proper song when going from ablum.php to album_detail.php Everything else on the page works putting the right songs on the page. That tells me my joins are working properly. It

Just don’t know how to get the songs file to go with the correct album and steam the file. The song file is in the database in the songs.song_file.

 

<?php do { ?>

<table width="100%" border="0" cellspacing="0" cellpadding="2">

<tr>

<td width="43%" align="right"><div align="left"><a href="<?php echo $row_rs_album_detail['song_file']; ?>?albumID=<?php echo $row_rs_album_detail['albumID']; ?>"><?php echo $row_rs_album_detail['song_name']; ?></a></div></td>

<td width="57%" align="left"><?php echo $row_rs_album_detail['song_time']; ?></td>

</tr>

<tr>

<td colspan="2"><img src="images/Line.gif" width="542" height="8"></td>

</tr>

</table>

<?php } while ($row_rs_album_detail = mysql_fetch_assoc($rs_album_detail)); ?>

 

Link to comment
Share on other sites

Can someone point me in the right direction? I am using Dreamweaver MX 2004 and need help with a dynamic site. I am using mysql and PHP through Dreamweaver.

I have a record store selling on artist’s albums.

The album.php page shows all the albums and allows you to select which album you want to see detail. The albumID is passed to the album_detail.php page. This page has album descriptions, price, etc. It also list the songs In the album. This all works. I want the viewer to click on the sing name and it will play a sample of the songs. That’s where I am having a problem. See below.

I have a database with a table album  and  song. Following is the database  sql. on.

 

/*

SQLyog Enterprise v4.0

Host - localhost : Database - isaiahrecords

**************************************************************

Server version 4.0.0-alpha-nt

*/

 

create database if not exists `isaiahrecords`;

 

use `isaiahrecords`;

 

/*

Table structure for album

*/

 

drop table if exists `album`;

CREATE TABLE `album` (

  `albumID` int(11) NOT NULL auto_increment,

  `album_name` varchar(70) default NULL,

  `album_description` text,

  `album_price` varchar(7) default NULL,

  `album_cover` varchar(100) default NULL,

  `album_coverthumbnailURL` varchar(100) default NULL,

  `album_special` char(3) default NULL,

  `album_buy` varchar(255) default NULL,

  PRIMARY KEY  (`albumID`)

) TYPE=MyISAM;

 

/*

Table data for isaiahrecords.album

*/

 

INSERT INTO `album` VALUES

(1,'Ask','This cd is dedicated to the many children of God who are smooth jazz lovers. The project is a presentation of familiar jazz tunes that have been remixed, rewritten and crossed over to portray a version that expresses the life of Christ and timelessness of His Word. Get ready jazz lovers, this one will keep you with your finger on the repeat button. The Jazz Project , created for your listening pleasure. Enjoy it with all of your friends.','15','Albumcovers/ask.jpg','Thumbnails/ask_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=Ask Album CD&price=15.00&units=1&return=isaiahrecords.com'),

(2,'Crossing Over','This cd is dedicated to the many children of God who are smooth jazz lovers. The project is a presentation of familiar jazz tunes that have been remixed, rewritten and crossed over to portray a version that expresses the life of Christ and timelessness of His Word. \n\nGet ready jazz lovers, this one will keep you with your finger on the repeat button. The Jazz Project - created for your listening pleasure. Enjoy it with all of your friends.','15','Albumcovers/jass.jpg','Thumbnails/jass_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=The Jazz Project Album&price=15.00&units=1&return=isaiahrecords.com'),

(3,'One More Night with The Frogs','One More Night With The Frogs - Presenting  new album from Arthur. It is an uplifting mixture of smooth jazz and some originals from Arthur that will truly bless your soul. And of course, there is \"The Frog!\".','15','Albumcovers/frog.jpg','Thumbnails/frog_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=One MoreI Night With The Frogs&price=15.00&units=1&return=isaiahrecords.com'),

(4,'Making Music I - Authur & Family','Arthur and Family Vol. 1 offers an assortment of Arthur’s most requested concert selections like “I’ll Tell It” and “Center Of My Joy.” This project includes a captivating background vocal mix featuring some of the most gifted vocalist from Arthur’s church family. Listen to the debut of Arthur’s daughter Alex as she sings lead on the crossover and remix of the song “Missing You” which also includes a special debut of the poetic voice of her mother Jill. The songs on Family Vol. 1 are prepared and selected for the enjoyment of the whole family! ','15','Albumcovers/mm1.jpg','Thumbnails/mm1_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=Making Music II II Album&price=15.00&units=1&return=isaiahrecords.com'),

(5,'Making Music II - Authur & Family','Arthur and Family Vol. 2 presents a “live” concert performance where Arthur is joined by friends who present a variety of musical styles and talents. The background vocalists from Vol. 1 are out front singing inspirational songs of worship and praise. Listen for yourself and experience praise and worship in an atmosphere filled with joy and excitement. Join in and sing along to some of your favorite tunes!','15','Albumcovers/mmII.jpg','Thumbnails/mmII_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260&product=Family Album CD&price=15.00&units=1&return=isaiahrecords.com'),

(6,'Christms Joy','Christmas Joy Enjoy your holiday season with Arthur and the Northside Baptist Celebration Choir, singing a selection of favorite Christmas songs. Prepare to clap and sing along as Arthur and the Sarasota Baptist Church Choir sing their special rendition of “I Have Seen the Light” and “Go Tell It On The Mountain.” Reminisce on Christmases past while listening to medleys of popular Christmas classics, which include \"Chestnuts Roasting On An Open Fire.” Christmas Joy is a CD that you’ll want to listen to all year round! \n\n','15','Albumcovers/christmasjoy.jpg','Thumbnails/christmasjoy_thumb.jpg','no','http://www.aitsafe.com/cf/add.cfm?userid=3351260_\"uct=Christian Joy CD&price=15.00&units=1&return=isaiahrecords.com');

 

/*

Table structure for albumkey

*/

 

drop table if exists `albumkey`;

CREATE TABLE `albumkey` (

  `albumkeyID` int(11) NOT NULL auto_increment,

  `albumID` int(11) default NULL,

  `songsID` int(11) default NULL,

  PRIMARY KEY  (`albumkeyID`)

) TYPE=MyISAM;

 

/*

Table data for isaiahrecords.albumkey

*/

 

INSERT INTO `albumkey` VALUES

(1,1,1),

(2,1,2),

(3,2,3),

(4,2,4),

(5,3,5),

(6,3,6),

(7,4,7),

(8,4,8),

(9,5,9),

(10,5,10),

(11,6,11),

(12,6,12);

 

/*

Table structure for songs

*/

 

drop table if exists `songs`;

CREATE TABLE `songs` (

  `songsID` int(11) NOT NULL auto_increment,

  `song_name` varchar(50) default NULL,

  `song_file` varchar(100) default NULL,

  `song_time` varchar(10) default NULL,

  PRIMARY KEY  (`songsID`)

) TYPE=MyISAM;

 

/*

Table data for isaiahrecords.songs

*/

 

INSERT INTO `songs` VALUES

(1,'Ask','http://isaiahrecords.com/Music/Ask/Ask.ram','3'),

(2,'Are you sure','http://isaiahrecords.com/Music/Ask/Are you sure.ram','3'),

(3,'In The Beginning','http://iasishrecords/Music/Jass_Project/IN_THE_BEGINNING.RAM','3'),

(4,'Moomba','http://isaiahrecords/Music/Jass_Project/MOOMBA.RAM','3'),

(5,'Frog','http://isaiahrecords/Music/One_More_Night_With_The_Frogs/Frog.ram','3'),

(6,'Good Fruit','http://isaiahrecords/Music/One_More_Night_With_The_Frogs/Good_Fruit.ram','3'),

(7,'You Bring Me Up','http://isaiahrecords/Music/MMV1/Bring me up.ram','3'),

(8,'Jesus Loves Me','http://isaiahrecords/Music/MMV1/Jesus Loves me.ram','3'),

(9,'O Happy Day','http://isaiahrecords/Music/MMV2/O Happy day.ram','3'),

(10,'People Get Ready','http://isaiahrecords/Music/MMV2/People get ready.ram','3'),

(11,'A King Is Born','http://isaiahrecords/Music/Christmas_Joy/KING IS BORN.RAM','3'),

(12,'Amen','http://isaiahrecords/Music/Music/Christmas_Joy/AMEN.RAM','3');

The pages are album.php and album_detail.php. The album.php feeds the album_detail.php with the albumID.

 

The recordset rs_album_detail is as follows:

SELECT album.albumID,album.album_cover,album. album_name, album.album_description, album.album_price, album.album_buy, songs.song_name, songs. song_time, songs.song_file

FROM album, albumkey, songs

WHERE album.albumID = albumkey.albumID AND songs.songsID = albumkey.songsID AND album.albumID = colname

 

The variables box I have :

Name =Colname  Value =1, and runtime=$HTTP_GET_VARS['albumID']

 

Code: <?php

$colname_rs_album_detail = "1";

if (isset($HTTP_GET_VARS['albumID'])) {

  $colname_rs_album_detail = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['albumID'] : addslashes($HTTP_GET_VARS['albumID']);

}

mysql_select_db($database_cn_isaiahrecords, $cn_isaiahrecords);

$query_rs_album_detail = sprintf("SELECT album.albumID,album.album_cover,album. album_name, album.album_description, album.album_price, album.album_buy, songs.song_name, songs. song_time, songs.song_file FROM album, albumkey, songs WHERE album.albumID = albumkey.albumID AND songs.songsID = albumkey.songsID AND album.albumID = %s", $colname_rs_album_detail);

$rs_album_detail = mysql_query($query_rs_album_detail, $cn_isaiahrecords) or die(mysql_error());

$row_rs_album_detail = mysql_fetch_assoc($rs_album_detail);

$totalRows_rs_album_detail = mysql_num_rows($rs_album_detail);

?>

I am trying to play a audio stream from the songs table: I dragged The  {rs_album_detail.song_name} from the recordset and went to the link box in properties, clicked on datasource and selected song_file from  the record set. It is not selecting the proper song when going from ablum.php to album_detail.php Everything else on the page works putting the right songs on the page. That tells me my joins are working properly. It

Just don’t know how to get the songs file to go with the correct album and steam the file. The song file is in the database in the songs.song_file.

 

<?php do { ?>

      <table width="100%"  border="0" cellspacing="0" cellpadding="2">

        <tr>

          <td width="43%" align="right"><div align="left"><a href="<?php echo $row_rs_album_detail['song_file']; ?>?albumID=<?php echo $row_rs_album_detail['albumID']; ?>"><?php echo $row_rs_album_detail['song_name']; ?></a></div></td>

          <td width="57%" align="left"><?php echo $row_rs_album_detail['song_time']; ?></td>

        </tr>

        <tr>

          <td colspan="2"><img src="images/Line.gif" width="542" height="8"></td>

        </tr>

      </table>

      <?php } while ($row_rs_album_detail = mysql_fetch_assoc($rs_album_detail)); ?>

225376[/snapback]

 

I can't see how you are streaming an audio file of any kind. Is it mp3? WMA?

 

The easiest way is to generate an .m3u file that points to and streams an mp3.

 

What media are you trying to play?

 

Link to comment
Share on other sites

I can't see how you are streaming an audio file of any kind. Is it mp3? WMA?

 

The easiest way is to generate an .m3u file that points to and streams an mp3.

 

What media are you trying to play?

226887[/snapback]

 

****************************************************

 

I am trying to stream real. The files are ram files that point to rm files.

 

When the album is slected from album.php it goes to album detail.php. A list of the songs in that album show up.

 

If you click on a song it is supposed to stream. See www.isaiahrecord.com/album.php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.