Home Parse xml longblob from mysql with php
Reply: 0

Parse xml longblob from mysql with php

user841
1#
user841 Published in June 21, 2018, 1:01 am

I having problems to read a column type longblob that containing a file XML. If I entry to phpmyadmin and I make click at column myxml (type longblob) this download a file .bin that contain a XML, but if make a SELECT to my column myxml whit PHP and MySql, this only shows a white space.

My code:

$dbquery = $data -> prepare("SELECT TABLE_1.ISSUEDDATE, TABLE_1.TOTAL, TABLE_1.ISSUERRFC, TABLE_1.RECEIVERRFC, TABLE_1.UUID, TABLE_1.FOLIO, TABLE_2.BYTES, CONVERT(BYTES USING utf8) AS XML FROM DOCUMENT TABLE_1 INNER JOIN FILE TABLE_2 ON TABLE_1.XML_ID = TABLE_2.ID WHERE TABLE_1.ID = 244938 ORDER BY TABLE_1.ID");
$dbquery -> execute();               

while($rows = $dbquery -> fetch(PDO::FETCH_ASSOC)):
$rowsxml = new SimpleXMLElement($rows['XML']);
print_r($rowsxml);
endwhile;
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301262 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO