Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8587481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:34:47+00:00 2026-06-11T22:34:47+00:00

Help me to create an XML format like this : http://telkomvision.com/soap/timetable/monday.xml The code that

  • 0

Help me to create an XML format like this :

http://telkomvision.com/soap/timetable/monday.xml

The code that I have made like this :

<?php
date_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 = 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>";
?>

And my code result is :

http://telkomvision.com/soap/timetable/CreateXML.php

My 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:34:48+00:00Added an answer on June 11, 2026 at 10:34 pm

    Bertho, you should look into XQuery as an option for restructuring XML documents. There are also several software vendors offering SQL applications, some free some paid, which have XML handlers. Unless you’re trying to avoid using a querying language, I think that you should use a querying language rather than PHP. I struggled to edit XML in PHP for a long time, and I’ve found that creating code that’s as well made as the query language code via PHP isn’t worth the effort. You’re going to be troubleshooting errors and adding routines to handle errors and exceptions and struggling to optimize for months if you use PHP, I think; on the other hand, you could use a query language for a day or two and be through with it. XQuery is very easy to learn, it’s web standards, and it supports XPath 2.0. You’ll definitely be happier with that than you are with XPath or SimpleXML. You also might consider XSLT. Some people prefer that because it requires less administration, but I like XQuery better for its simplicity.

    If you’re willing to work with XQuery, I think I can post the code necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this XML structure that I wish to construct in JSON format using
Can someone help me create an index/count button for a UITableView, like this one?
I have XML data like this: <data ItemCount=5> <zrow GroupName=ManagerUser=User1 /> <zrow GroupName=DeveloperUser=User2 />
I would like to create junit report programmatically using ant. I've seen that this
i need to convert from a HTML-like xml format to WordML. I have a
I want a program that would help me create virtual devices on a virtual
i am new in Cassandra db. need help to create data model. i have
I'm trying to create a Help/About screen for my application, but I've discovered that,
I have a Perl program that I've written that parses SQL-like statements and creates
Could someone please help me. I'm trying to create an xml list with all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.