Re: XML Continued
| From: | Miles Thompson | Date: | Thu, 28 Dec 2000 15:56:43 +0000 |
| Subject: | Re: XML Continued | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32085@lists.php.net to get a copy of this message | ||
Dumb, but simple high-level answer ...
Build a lookup table (either MySQL or an array) so that if incoming field names are different from what you use you can store data using your field names.
Parse the XML stream file, comparing the XML tags with your lookup table
Between each begin / end of record tag, build a string using appropriate field names with the data from the XML stream.
Append this string to a INSERT statement and execute
Repeat.
I'd also check and see what XML handling functions PHP already has, as this is a fairly antiquated approach -- essentially parsing a text file. And Christopher's suggestion as well.
Happy New Year - Miles
At 09:42 AM 12/28/2000 -0600, Christopher Allen wrote:
M, I have been searching for information but turning up a blank. What is the best way to store XML data in a MySQL or other database From what I have heard a future release (soon?) of mysql will map xml tags to mysql cols. Look at their site for more info.... GL, Christopher -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net