PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, January 23, 2022

[FIXED] how to execute XML data in to phpmyadmin Database

 January 23, 2022     mysql, phpmyadmin, sql, xml     No comments   

Issue

Hear is my XML data set. I want to execute this file format in to phpMyAdmin database.

<?xml version="1.0" standalone="yes" ?>
<NewDataSet>
    <company>
        <COM_CODE>Test Data</COM_CODE>
        <COM_NAME>Test Data</COM_NAME>
        <COM_ADDRESS>Test Data</COM_ADDRESS>
    </company>
</NewDataSet>

Solution

There are two functions available for providing basic XPath 1.0 (XML Path Language, version 1.0) in MySQL.Which are

ExtractValue():Extracts a value from an XML string using XPath notation

UpdateXML():Return replaced XML fragment

Simplest example for executing XML is:

SELECT ExtractValue('<NewDataSet><company><COM_CODE>Test Data</COM_CODE></company></NewDataSet>', '/NewDataSet/company/COM_CODE');//returns Test Data which is value inside <COM_CODE></COM_CODE>

For more see Mysql Docs MYSQL XML Functions



Answered By - Hikmat Sijapati
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing