Hi,
I bet you guys can help me on this. I don't know how to handle xml files. Here's the scenario, I have XML file, i want that each data from my xml file will be inserted into my database. How can I do that?
Insert XML data to SQL table
Page 1 of 15 Replies - 1340 Views - Last Post: 04 March 2011 - 08:58 AM
Replies To: Insert XML data to SQL table
#2
Re: Insert XML data to SQL table
Posted 03 March 2011 - 02:29 AM
Solution.
When you get the data that you want in XML send it to SQL Server
VIA your requirement , i would put an insertcommand in a loop .
With each iteration through the XML File I would send it to specific field
in the database
Not so hard is it.
When you get the data that you want in XML send it to SQL Server
VIA your requirement , i would put an insertcommand in a loop .
With each iteration through the XML File I would send it to specific field
in the database
Not so hard is it.
This post has been edited by marinus: 03 March 2011 - 02:34 AM
#3
Re: Insert XML data to SQL table
Posted 04 March 2011 - 12:25 AM
Most modern DBMSs have built in features to handle xml data. Depending on what database you are using, you should look into that. I know MS Sql Server 2005 and up has an xml data type. You could pass the contents of the xml file to a stored procedure and insert the data that way...
#4
Re: Insert XML data to SQL table
Posted 04 March 2011 - 02:49 AM
thanks... I'm using PHP and My Sql. Anyone can give me sample functions or class on this?
#5
Re: Insert XML data to SQL table
Posted 04 March 2011 - 05:40 AM
I'm going to move this to PHP, because that's probably the best place for it.
Have you mapped your XML schema to a database table? If you provide some example data and code, we can help.
Have you mapped your XML schema to a database table? If you provide some example data and code, we can help.
#6
Re: Insert XML data to SQL table
Posted 04 March 2011 - 08:58 AM
I would suggest using
And then html_entity_decode when you retrieve it from the database.
htmlentities($xmlData,ENT_QUOTES)
And then html_entity_decode when you retrieve it from the database.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote






|