How to add Node to Generate XML file

droiddoll

New Member
Help me to create an XML format like this :http://telkomvision.com/soap/timetable/monday.xmlThe code that I have made like this :\[code\]<?phpdate_default_timezone_set("Asia/Jakarta");$NowDate = date("Y-m-d G:i:s");$FormatWM = date('Y-m-d',strtotime($NowDate));$FormatLagi = date('Y-m-d',strtotime($NowDate));mysql_connect("localhost", "root", "");mysql_select_db("telkncom_epg");$namaTabel = "epg";header('Content-Type: text/xml');$query = "SELECT * FROM $namaTabel where tgl_mulai='26-SEP-12' limit 0,30";$hasil = mysql_query($query);$jumField = mysql_num_fields($hasil);echo "<?xml version='1.0' ?>";echo "<data>";while ($data = http://stackoverflow.com/questions/12597500/mysql_fetch_array($hasil)){ echo"<".$namaTabel.">"; for ($i=0; $i<=$jumField-1; $i++) { $namaField = mysql_field_name($hasil, $i); echo "<".$namaField.">".$data[$namaField]."</".$namaField.">"; } echo "</".$namaTabel.">";}echo "</data>";?>\[/code\]And my code result is :http://telkomvision.com/soap/timetable/CreateXML.phpMy Database design :| id | channel_code | channel_name | date | s_time | e_time | topic | sinps |What should I change in my code to get the results that I want?
 
Back
Top