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 8765061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:11:38+00:00 2026-06-13T16:11:38+00:00

I have to develop one xml feed from mysql database using php code..here i

  • 0

I have to develop one xml feed from mysql database using php code..here i have to insert or update any data on my mysql database means that inserted and updated data automatically change and insert on my xml feed also without refresh the page.how can i develop this.please help me.

i have used below code:

$catname=func_query_first_cell("select status from $sql_tbl[orders] where status='Q'");
     $file= fopen("orderdetails1.xml", "w");        
     $_xml ="<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\r\n"; 
     $_xml .="\t<Feed>\r\n";
     $_xml .="\t<order>\r\n";

$_xml .="\t<status>" .htmlspecialchars($catname,ENT_QUOTES). "</status>\r\n";   
$page = (int) (!isset($_GET["page"]) ? 1 : $_GET["page"]);
$limit = 2;
$startpoint = ($page * $limit) - $limit;
$statement = "`xcart_orders` where `active` = 1";    
$counterr=0;
$r=func_query("select * from $sql_tbl[orders] LIMIT {$startpoint}, {$limit}");
foreach($r as $n)
 {
$products=func_query_first("select * from $sql_tbl[orders] where status='Q'");
 $products=func_query_first("select product from $sql_tbl[order_details] where orderid=$n[orderid]");

$infeed_counter++;

 echo $manufacturer."=====";

if($row[avail]>0)
                $avail='Y'; 
            else 
                $avail='N'; 


$_xml .="\t<Order>\r\n";
  $_xml .="\t<orderid>" .$n[orderid]. "</orderid>\r\n";
   $_xml .="\t<login>" .  htmlspecialchars(strip_tags(substr($n[login],0,50)) , ENT_QUOTES ). "</login>\r\n";   
$_xml .="\t<total>" . $n[total]. "</total>\r\n";
    $_xml .="\t<product>" .  $products[product]. "</product>\r\n";
    $_xml .="\t</Order>\r\n";   
}

    $_xml .="\t</order>\r\n";   
    $_xml .="\t</Feed>\r\n";    
fwrite($file, $_xml);       
 fclose($file);     
echo "XML version of products available here with $infeed_counter products.  <a href=\"orderdetails1.xml?page=$page\">View the XML.</a>";
     exit;
     ?>

Now i got the below xml feed:

<Feed>
<order>
<status>Q</status>
<Order>
   <orderid>1</orderid>
        <login>krishna</login>
        <total>399.99</total>
        <product>Designing Web Usability</product>
</Order>
 <Order>
        <orderid>65</orderid>
        <login>krishna</login>
        <total>399.99</total>
        <product>Three Stone Princess Cut Diamond Ring</product>
  </Order>
 <Order>
          <orderid>2</orderid>
          <login>krishna</login>
          <total>34.65</total>
           <product>Three Stone Princess Cut Diamond Ring</product>
</Order>

Now i wish to change the total 399.99 to 500.00 for orderid=1 on my mysql database means have to refresh the page.then only my xml feed is changed here.but i wish to need the solution is the database change is automatically update on my xml feed without refresh the page.please help me.how can i develop this.

  • 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-13T16:11:40+00:00Added an answer on June 13, 2026 at 4:11 pm

    Try like this:
    feed.php

    $catname = func_query_first_cell("select status from $sql_tbl[orders] where status='Q'");
    $file = fopen("orderdetails1.xml", "w");
    $_xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
    $_xml .= "<Feed>";
    $_xml .= "<order>";
    
    $_xml .= "<status>" . htmlspecialchars($catname, ENT_QUOTES) . "</status>";
    $page = (int)(!isset($_GET["page"]) ? 1 : $_GET["page"]);
    $limit = 2;
    $startpoint = ($page * $limit) - $limit;
    $statement = "`xcart_orders` where `active` = 1";
    $counterr = 0;
    $r = func_query("select * from $sql_tbl[orders] LIMIT {$startpoint}, {$limit}");
    foreach ($r as $n)
    {
        $products = func_query_first("select * from $sql_tbl[orders] where status='Q'");
        $products = func_query_first("select product from $sql_tbl[order_details] where orderid=$n[orderid]");
    
        $infeed_counter++;
    
        // echo $manufacturer."=====";
    
        if ($row[avail] > 0)
            $avail = 'Y';
        else
            $avail = 'N';
    
    
        $_xml .= "<Order>";
        $_xml .= "<orderid>" . $n[orderid] . "</orderid>";
        $_xml .= "<login>" . htmlspecialchars(strip_tags(substr($n[login], 0, 50)), ENT_QUOTES) . "</login>";
        $_xml .= "<total>" . $n[total] . "</total>";
        $_xml .= "<product>" . $products[product] . "</product>";
        $_xml .= "</Order>";
    }
    
    $_xml .= "</order>";
    $_xml .= "</Feed>";
    
    header ("Content-Type:text/xml"); 
    echo $_xml;
    

    in the XML feed URL access like this:

    http://www.exampleyourdoamin/feed.php

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

Sidebar

Related Questions

I have develop one simple database application build using SilverLight5.0 + Entity Framework +
I have develop one web site in php. I know how to upload it
I have to develop one ExpandableListView. Here i wish to set the arrow icon
Hi i have to develop one expandablelistview android app.here i wish to create relativelayout
i have developed one xml parsing exmaple.here i have to use expandable listview.but i
I have sucessfully used Farseer to develop one of my game using XNA .
I have a one red5 application using flex. Now I just want to develop
Hi i have develop and deploy one multilingual (english uk and swedish) website at
I have to develop a application (Winforms-application) which is connected to a database within
I have to develop a program where I need to get the event from

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.