Take data from an XML file and put it into a MySQL database
I'm looking to construct a script that would go through an XML file. Would find specific tags in it, put them in a table and fill the table with specific tags within them. I'm using MySQL 5.1 so loadXML isn't an option and I think that ExtractData() method wont be much use either.. but I开发者_StackOverflow中文版 don't really know. What would be the best way to go about this?
edit// I know how to do all of this in C except the creating the new tables in a database, how would I do that in C?
Per your edit, using the MySQL client library, you would just use mysql_query() with the standard CREATE TABLE syntax.
I'm not quite sure why you are doing it the way you are doing it, but I'm not working on whatever you are working on :)
Have a look at this blog. It will explain you how to do this using ExtraceValue() and also look at XML Functions.
精彩评论