Using PHP to query an XML document
Date: 06/25/05
(PHP Community) Keywords: xml, database, sql
Okay, the subject's kind of vague, but here is what I need to do:
Right now, the Perl programmers are using a perl script to do a database dump of multiple tables into XML format, and Im using cURL to retrieve that XML.
Now here is the problem, for some reason, they refuse to handle the proper SQL selections for what I need, so basically, I need to correlate the data in the different nodes (tables) to each other.
For instance, I have one node that contains the foreign key of another node, which then holds the foreign key of another node.
Ill give you a good example of what I need to do:
machine_user_map contains the package_service_id.
I then need to grab the package_id from package where the package_id in package_service is the same as the package_id in package.
Then, I need to grab the package name from package.
I've been using XPath so far, but there is no way to do multiple select-type commands with XPath like there is in SQL.
Does anyone have a good solution for handling this sort of thing?
Thanks in advance :)
Source: http://www.livejournal.com/community/php/312736.html