1

I don't know if anyone can help me with this. But can anyone tell me how can I map an XML script into mysql database? Lets say the web service provider has a XML script that returns the hotel classifications. Instead of running this script everytime I run a search query, I want it to save into the database and use the database table instead of the XML script. Can anyone help me with this?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Fady Sawan
  • 11
  • 2

2 Answers2

0

You shouldn't work with XML from a webservice directly. Use a proxy class which automatically serialize and desearialize the XML for you into a "Hotel" object.

joshgo
  • 1,164
  • 1
  • 9
  • 14
  • Well can you tell me this in a simpler way? I'm still a noob in using XML. I'm using PHP by the way – Fady Sawan Aug 30 '11 at 13:02
  • Not too familiar with PHP, but you can start looking at this: http://pear.php.net/package/XML_Serializer – joshgo Aug 30 '11 at 13:08
0

Put your XMl into a SimpleXMLElement object. You can find an example of how to do that via my answer here.

Community
  • 1
  • 1
John
  • 3,296
  • 2
  • 24
  • 36