[UPHPU] XML to SQL

Lonnie Olson fungus at aros.net
Thu Jul 6 12:21:20 MDT 2006


On Jul 5, 2006, at 5:13 PM, Brady Mitchell wrote:
> I need to parse an XML file and create SQL statements, and I'm
> struggling to find examples online.  There are lots of examples on
> creating XML files from a database, but not the other way.
>
> Anyone have any tips or online tutorials that would be helpful for  
> this?

There probably won't be any tutorials as each instance will be highly  
customized.  If you find a tutorial on XML parsing, you can combine  
that with your own SQL building logic.

Depending on the complexity of your XML document you may be able to  
use the SimpleXML extension (http://www.php.net/manual/en/ 
ref.simplexml.php).  This is my favorite way to parse small XML  
documents.

If you are a lot more specific we would be more than willing to help  
you out even more.  What kind of XML document are you talking about  
(RSS, XHTML, SOAP, XMLRPC, etc)?  Also your project will depend on  
the structure of your database table as well.

--lonnie


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2593 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20060706/835b358f/smime.bin


More information about the UPHPU mailing list