0

How can I parse an xml string <description>content</description> and move the content into my database with PHP7?

Example:

Database Structure:

ID;
NAME;
DESCRIPTION;

XML:

<thing>
<id>1</id>
<name>aaa</name>
<description>something</description>
ecc...
</thing>

So, let's pretend we modified every column for mistake but we have saved everything in a XML file, but the SQL is very big to modify manually, so we could do what I explained before. How could I accomplish this? Thanks in advance, and sorry if this question is very strange.

Full Stack Alien
  • 11,244
  • 1
  • 24
  • 37
Jason
  • 1
  • 5
  • Possible duplicate of [Parsing XML data using php to put into mysql database](https://stackoverflow.com/questions/2161722/parsing-xml-data-using-php-to-put-into-mysql-database) – Full Stack Alien Aug 07 '17 at 20:06
  • What have you tried? Do you use a CSV file as database? Please provide more infos about the XML structure or post a better example. – odan Aug 07 '17 at 20:45
  • I did just an example at the moment to show you more details. I didn't know how to explain, because is a long process. – Jason Aug 07 '17 at 23:43

0 Answers0