Hi all,
I am using the SELECT statement to filter some data from a MYSQL database and then convert it to an XML file to use in some flash graphs. (Code below)
It all works beautifully until I slip the COUNT(*) function into the SELECT statement. It displays the correct data but won't create an actual XML file. It throws this error:
XML Parsing Error: not well-formed
Location: file:///C:/a5v9/A5Webroot/GRO/test.xml
Line Number 5, Column 9:
<COUNT(staff) Type="N">1</COUNT(staff)>
----------------------^
NB: It's actually pointing to the brackets.
Code:
----------------------------------------------------------
qry = "SELECT staff, COUNT(staff) FROM customers where dealerID="+1+" GROUP BY staff limit 10"
if conn.open("{A5API=MySQL,Server='localhost',Port='3306',UserName='root',Password='��������',Database='groonline'}") = .f. then
data = "Failed to connect"
else
data = conn.ToXML(qry, args, -1, -1, "DocName", "Row")
file.from_string("test.xml", data)
end if
conn.Close()
? data
--------------------------------------------------------------
So, how can I get alpha to strip only the brackets out of the data?
Desperatly trying to meet a very tight dealine so any ideas or thoughts are greatly appreciated!!
Thanks guys,
Pat
I am using the SELECT statement to filter some data from a MYSQL database and then convert it to an XML file to use in some flash graphs. (Code below)
It all works beautifully until I slip the COUNT(*) function into the SELECT statement. It displays the correct data but won't create an actual XML file. It throws this error:
XML Parsing Error: not well-formed
Location: file:///C:/a5v9/A5Webroot/GRO/test.xml
Line Number 5, Column 9:
<COUNT(staff) Type="N">1</COUNT(staff)>
----------------------^
NB: It's actually pointing to the brackets.
Code:
----------------------------------------------------------
qry = "SELECT staff, COUNT(staff) FROM customers where dealerID="+1+" GROUP BY staff limit 10"
if conn.open("{A5API=MySQL,Server='localhost',Port='3306',UserName='root',Password='��������',Database='groonline'}") = .f. then
data = "Failed to connect"
else
data = conn.ToXML(qry, args, -1, -1, "DocName", "Row")
file.from_string("test.xml", data)
end if
conn.Close()
? data
--------------------------------------------------------------
So, how can I get alpha to strip only the brackets out of the data?
Desperatly trying to meet a very tight dealine so any ideas or thoughts are greatly appreciated!!
Thanks guys,
Pat
Comment