PHP音频阵列? [英] PHP Audio Array?

查看:267
本文介绍了PHP音频阵列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然是MySQL的新手,并且知道我的PHP方式但不完全。


我正在创建一个可以在这里查看的音频数据库: http://elixclothing.com/connection.php


我试图找出如何查询所有音频位置并将它们放入我的媒体根据按下哪个音频按钮可以播放的播放器。


我有一些想法,我想知道是否应该将audiolocation列移动到新表中,这样我就可以更轻松地选择它们而不会压力我当前的表。或者按照 http的内容进行操作。 ://bytes.com/topic/php/answers/7...y-one-row-time

我目前的代码如下:

Im still new to MySQL and know my way around PHP but not fully.

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:

展开 | 选择 | Wrap | 行号

推荐答案

我可以帮一点点。首先,我很好奇你为什么要为每首曲目使用一个单独的div,你不需要这样做。我也在试图找出你为什么要使用quicktime而你应该使用类似基于flash的播放器的东西。


首先,你必须明白你''设置多个div,所有div都具有相同的ID。您的javascript使用的是硬编码IDtoggleMe。显示或隐藏玩家div。由于它们都具有相同的ID,因此会导致问题。你应该让数据库中的每个轨道都有它自己的唯一ID,你可以将它附加到div的ID上,例如:


track_id = 0

cue_code = OPUS10.013_12

cue_title =她将成为One Ver。 2

cue_description =下划线

时间= 01:48:00


那么你的代码会使用那个独特的track_id作为div 's ID:


< div id =" toggleMe_0" ...


然后你的javascript函数toggleDisplay()会改变to toggleDisplay(divID),你将替换toggleMe的所有硬编码实例。在实际函数中divID,如下所示。我还创建了一个名为obj的变量,这样你就不必多次输入整个document.getElementById行了:

I can help a little bit. First, I''m curious as to why you''re using a separate div for each track, you don''t need to do that. I''m also trying to figure out why you''re using quicktime when you should instead use something like a flash-based player.

First off, you have to understand that you''re setting multiple divs, all with the same ID. Your javascript is using the hard-coded ID "toggleMe" to show or hide the player div. Since they all have the same ID this causes issues. You should have each track in the database have it''s own unique ID which you could append to the div''s ID, for example:

track_id = 0
cue_code = OPUS10.013_12
cue_title = She''ll Be The One ver. 2
cue_description = underscore
time = 01:48:00

Then your code would use that unique track_id as the div''s ID:

<div id="toggleMe_0"...

then your javascript function toggleDisplay() would change to toggleDisplay(divID) and you''d replace all hardcoded instances of "toggleMe" to divID in the actual function, like below. I also made a variable named obj, so that you don''t have to type the whole document.getElementById line so many times:

展开 | 选择 | Wrap | 行号


@ HaLo2FrEeEk


我真的不能够感谢你!你终于给了我一个与我想要做的事情有关的智能回应。我在其他论坛上花了很多次试图寻求帮助。


我已经做了你推荐的补充,我也有一个ID。在我的表中的列。

@HaLo2FrEeEk
I really cant thank you enough! You have finally given me an intelligent response that relates to what I am trying to do. Ive spent so many times on other forums trying to get some help.

I have made the additions you recommended, also I do have a "ID" column in my table.

展开 | 选择 < span class =codeDivider> | Wrap | 行号


该播放器可以正常工作,您只需构建一个动态播放列表,格式为玩家读取。


您是否正在尝试构建与该示例站点完全相同的内容?按流派,艺术家,专辑,标题等排序?对于那些已经完成死亡的事情来说,这是相当多的工作。
That player would work, you''d just build a dynamic playlist in the format that the player reads.

And are you trying to build something exactly like that example site? Sorting by genre, artist, album, title, etc? That''s quite a bit of work for somethig that''s already been done to death.


这篇关于PHP音频阵列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆