The user creates a XML-file and stores it in the database as BLOB. Every XML-file gets its own row.
My script should query the Database and retrieve the XML-file of every row.
Every XML-file should be in an own php object and stored in an array. After that I need to access the DOM of every XML to display the data in an html template.
This is what I have got so far:
$stmt = $pdo->query('SELECT xml FROM table');
foreach ($stmt as $row)
{
echo $row['xml'] . "\n";
}
It will output the information without the xml-tags. I wonder why. The problem is, I somehow need to access the DOM.
I read about
simplexml_load_file
but it needs a filepath, which I don't have because the files are stored as BLOB in the DB.
Thank you!