I'm creating a Audio Database that can be viewed here : http://elixclothing.com/connection.php
Im trying to figure out how to query all of the audio locations and put them in my media player which can be played according to which audio button is pressed.
I have a few ideas, I was wondering if I should move the audiolocation column to a new table so that I select them easier and not stress out my current table. Or follow something along the lines of this http://bytes.com/topic/php/answers/7...y-one-row-time
My current code is below:
Expand|Select|Wrap|Line Numbers
- <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='speaker_dark.gif' border=0></a>";
- echo "</tr>";
- }
- ?>
- </table>
- </body>
- </html>