mysql - Trying to Embed answer from SQL Query(PHP Variable) in XML doc -
Hi, this is my first posting, working on it for a few days, but there is no luck. Actually I ask a database in PHP, I am getting my answer, but I want to send this answer to an XML file for graph creation. Any help would be greatly appreciated
$ result = mysqli_query ($ con, as SELECT COUNT (*) from FullCount to DailyShpm embedded here Is a part of PHP file with sql. WHERE ('1 2013-01-01' and now () - between 1 year) and (product = 'AE') "); While ($ line = mysqli_fetch_array ($ result)) {echo $ line ['fullcount']; Echo "& lt; - Complete results for total AE for 2013"; Echo "& lt; br & gt;"; Echo ['fullcount'] per line; Echo "& lt; br & gt;"; $ Files = "data.xml"; // Load XML object $ xml = Simple XMLload_file ($ files); // Assign value $ xml- & gt; Set-> Value = $ line ['fullcount']; // $ xml- & gt; Chart - & gt; Set = $ line ['fullcount']; Store the value in // file_put_contents ($ file, $ xml- & gt; asXML ()); }
This is the result of the XML file
/ P>
Change the following:
$ xml- & gt; Set-> Value = $ line ['FullCount']; From
to:
$ xml- & gt; Properties () - & gt; Value = ((string) $ xml- & gt; attribute () - & gt; value) $ line ['FullCount'];
Comments
Post a Comment