Skip to content

Instantly share code, notes, and snippets.

@hidayat365
Created September 28, 2012 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hidayat365/3797653 to your computer and use it in GitHub Desktop.
Save hidayat365/3797653 to your computer and use it in GitHub Desktop.
XML buat @Bertho Joris
<?php
while ($r = mysql_fetch_array($q)) {
// open channel header
$CN = $r['channel_name'];
$xml .= "<channel name='".$CN."'>";
// event details for channel
$sql2 = "select * FROM epg where channel_name='".$CN."'";
$q2 = mysql_query($sql2) or die(mysql_error());
while($r2 = mysql_fetch_array($q2)) {
$Mulai = date('H:i', strtotime($r2['waktu_mulai']));
$Selesai = date('H:i', strtotime($r2['waktu_akhir']));
$Title = $r2['judul'];
$Desk = $r2['sinopsis'];
$xml .= "<event start='".$Mulai."' end='".$Selesai."'>";
$xml .= "<title>".$Title."</title>";
$xml .= "<description>".$Desk."</description>";
$xml .= "</event>";
}
// close channel
$xml .= "</channel>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment