MySQL Forums
Forum List  »  PHP

Re: MySQL + PHP Audio Reference
Posted by: Sam Hayward
Date: June 01, 2010 12:24AM

Changed Code Again to Fit the Table, audio works but it loads all the songs at once.

New Code:

<html>
<head>
<title>Test</title>
<script src="ac_quicktime.js" language="JavaScript" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
function toggleVisibility() {
document.getElementById("toggleMe").style.display = "";
if(document.getElementById("toggleMe").style.visibility == "hidden" ) {
document.getElementById("toggleMe").style.visibility = "visible";
}
else {
document.getElementById("toggleMe").style.visibility = "hidden";
}
}
function toggleDisplay() {
document.getElementById("toggleMe").style.visibility = "visible";
if(document.getElementById("toggleMe").style.display == "none" ) {
document.getElementById("toggleMe").style.display = "";
}
else {
document.getElementById("toggleMe").style.display = "none";
}
}
</script>

<table border="1" width="75%" cellpadding="2" cellspacing="2">
<tr>
<td align="center">Cue Code</td>
<td align="center">Cue Title</td>
<td align="center">Cue Description</td>
<td align="center">Time</td>
<td align="center"></td>
</tr>
<br />

<?php
mysql_connect("", "", "") or die(mysql_error());
echo "Connected to MySQL<br /><hr />";
mysql_select_db("elixclot_music") or die(mysql_error());
echo "Connected to Database<br /><hr />";
$query = "SELECT * FROM tracks";
$result = mysql_query($query) or die(mysql_error());
while($line = mysql_fetch_array($result)) {

// Audio Player Begins
echo "<div display='none' id='toggleMe' >
<p>".$line['cue_code']."</p>
<p>".$line['cue_title']."</p>
<OBJECT CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' WIDTH='290' HEIGHT='20'
CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab'>;
<PARAM name='SRC' VALUE=".$line['cue_code'].">
<PARAM name='AUTOPLAY' VALUE='true'>
<PARAM name='CONTROLLER' VALUE='true'>
<EMBED src=".$line[audiolocation]." WIDTH='290' HEIGHT='20'
AUTOPLAY='false' CONTROLLER='true'
PLUGINSPAGE='http://www.apple.com/quicktime/download/'>;
</EMBED>
</OBJECT>
</div>";
// Audio Player Ends



echo "<td align='center'>".$line['cue_code']."</td>";
echo "<td align='center'>".$line['cue_title']."</td>";
echo "<td align='center'>".$line['cue_description']."</td>";
echo "<td align='center'>".$line['time']."</td>";
echo "<td align='center'><a href='#' onclick='toggleDisplay();'><img src='http://opus1.o1engine.com/img/speaker_dark.gif'; border=0></a>";
echo "</tr>";
}
?>
</table>
</body>
</html>



Edited 1 time(s). Last edit at 06/01/2010 01:16AM by Sam Hayward.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL + PHP Audio Reference
June 01, 2010 12:24AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.