我创建了一个脚本,我们添加了'播放列表'。 在MySQL中就像:
Cod: 18, Playlist: teste, Looptande: 1, Starttime: 09:00
Cod: 19, Playlist: teste2, Looptande: 0, Starttime: 10:00
我正在尝试使用以下格式生成XML:
<playlist loopatend="1" shuffle="inherit">teste</playlist>
<calendar starttime="09:00">
第二
<playlist loopatend="0" shuffle="inherit">teste2</playlist>
<calendar starttime="10:00">
我想知道它是否检测到播放列表的数量,并如上所述正确重复。
我正在尝试这样做:
$qtd_ag = 0;
$sql_ag = mysql_query("SELECT * FROM event where codigo_stm = '".$dados_stm["codigo"]."' ORDER by playlist");
while ($dados_ag = mysql_fetch_array($sql_ag)) {
$ag_config_autodj .= "playlistfilename_".$qtd_ag."=".$dados_ag["playlist"]."\n";
$ag_config_autodj .= "playlistfilepath_".$qtd_ag."=/home/streaming/playlists/".$dados_stm["porta"]."-".$dados_ag["playlist"].".pls\n";
$ag_config_calendar = array ("loopatend" => $dados_ag["loopatend"], "priority" => $dados_ag["priority"], "playlist" => $dados_ag["playlist"], "starttime" => $dados_ag["starttime"], "duration" => $dados_ag["duration"], "repeat" => $dados_ag["repeatc"], "startdate" => $dados_ag["startdate"], "enddate" => $dados_ag["enddate"], "shuffle" => $dados_ag["shuffle"]);
$qtd_ag++;
}
$config_calendar = gerar_calendar_autodj($dados_stm["porta"],$djs_config_calendar,$ag_config_calendar);
$ssh->enviar_arquivo("../temp/".$config_autodj."","/home/streaming/configs/".$config_autodj."",0777);
$ssh->enviar_arquivo("../temp/".$config_calendar."","/home/streaming/configs/".$config_calendar."",0777);
unlink("../temp/".$config_autodj."");
unlink("../temp/".$config_calendar."");
功能第二:( function.php) 我不能在这里粘贴代码,我总是抱怨请原谅,但我需要帮助。然后将打印:
因此它创建了XML,但出现了与数据库不对应的值的错误:
<playlist loopatend="0" shuffle="0" priority="0" >array</playlist>
<calendar starttime="0" endtime="" repeat="128">
<playlist loopatend="0" shuffle="0" priority="0" >array</playlist>
<calendar starttime="0" endtime="" repeat="128">
答案 0 :(得分:0)
在图片中,您使用的是$$event[...]
。我认为那应该是$event[...]
。