Home:ALL Converter>PHP - Store value from simplexml_load_file in database

PHP - Store value from simplexml_load_file in database

Ask Time:2011-09-16T07:04:57         Author:John

Json Formatter

I am grabbing an external xml file and converting it into an array with simplexml_load_file in php. My question is, what would be the best way to store that information in a mysql database for processing later? I tried serializing it but I believe you cant do that? When I do I get node no longer valid error or something similiar. Any suggestions/help?

Author:John,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7438462/php-store-value-from-simplexml-load-file-in-database
GolezTrol :

If you got an XML file, why not store that XML and process it later altogether?",
2011-09-15T23:09:02
alex :

You can serialize it with serialize(), and then unserialize with unserialize(). However, you are often better normalising your data into columns/tables/etc so you can use the power of the database to query the data.",
2011-09-15T23:07:53
yy