Requesting mp3 files from a database
Am I able to select mp3 files from an external database rather than just uploading them in the same directory as the html where Flash MP3 Player is inserted? Answer:
The current version of Flash MP3 Player does not allow importing files from a database.
However, here are a few short examples on how you are able to import mp3 files from a database using PHP and ASP (JavaScript and VBScript):
PHP:
<?php
$row_count = 1;
do {
if ($row_count >1)
{
$strMP3 .= ";".$row_rsMP3['fname'];
}
else {$strMP3 = $row_rsMP3['fname'];}
$row_count++;
} while ($row_rsMP3 = mysql_fetch_assoc($rsMP3));
?>
flashMP3Player1.addVariable("mp3s", "<?php echo $strMP3;?>"); \\do not forget to change the function requesting the mp3 files
<%
row_count = 1;
do {
if (row_count > 1)
strMP3 += ";"+rsMP3.Fields("fname").Value;
else
strMP3 = rsMP3.Fields("fname").Value;
row_count ++;
rsMP3.MoveNext();
}
while (rsMP3.EOF)
%>
dyn_MP3_ASP.addVariable("mp3s", "<% Response.Write (strMP3) %>"); \\do not forget to change the function requesting the mp3 files
ASP using VBScript: <%
row_count = 1
Do While Not rsMP3.EOF
If row_count > 1 Then
strMP3 = strMP3&";"&rsMP3.Fields("fname").Value
Else
strMP3 = rsMP3.Fields("fname").Value
End If
rsMP3.MoveNext
row_count = row_count+1
Loop
%>
dyn_MP3_ASP.addVariable("mp3s", "<% Response.Write (strMP3) %>"); \\do not forget to change the function requesting the mp3 files
DISCLAIMER:
This is extra complimentary content which purpose is to show additional usage that is not part of the product, i.e. it suggests tips for extending the functionality of the product by the users themselves.
It is provided "as is", without warranty of any kind, express or
implied , including but not limited to the warranties of
merchantability, fitness for a particular purpose and nonfringement of
third party rights.
DMXzone does not take responsibility to
support the suggested content to be fully compatible and working as
intended and does not provide support for extended functionality which
is not included in the current release of the extension.
It is highly recommended that only more advanced developers use it.
Comments
Be the first to write a comment
You must me logged in to write a comment.