Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
通过PHP将MySQL查询转换为XML_Php_Mysql_Sql_Xml - Fatal编程技术网

通过PHP将MySQL查询转换为XML

通过PHP将MySQL查询转换为XML,php,mysql,sql,xml,Php,Mysql,Sql,Xml,我的课程中有这个PHP,我想使用服务器端编程以XML格式动态生成带有两个表的订单详细信息的待定订单。当我尝试运行这个时,我得到一个错误(如下),我相信它来自于查询。我是个新手,还没弄明白。如果您能帮上忙,我们将不胜感激!谢谢大家! XML分析错误:文档元素位置后出现垃圾邮件: hxxp://xxxx/xxxx/pending_details.php 第2行第1列: 尝试仅使用以下名称访问该行 $xml->writeAttribute('name', $row['name']); $xml-

我的课程中有这个PHP,我想使用服务器端编程以XML格式动态生成带有两个表的订单详细信息的待定订单。当我尝试运行这个时,我得到一个错误(如下),我相信它来自于查询。我是个新手,还没弄明白。如果您能帮上忙,我们将不胜感激!谢谢大家!

XML分析错误:文档元素位置后出现垃圾邮件: hxxp://xxxx/xxxx/pending_details.php 第2行第1列:


尝试仅使用以下名称访问该行

$xml->writeAttribute('name', $row['name']);
$xml->writeAttribute('quantity', $row['quantity']);
$xml->writeAttribute('date', $row['date']);
$xml->writeAttribute('pending', $row['pending']);

用print_r($row)输出您的内容并发布!
$xml->writeAttribute('name', $row['name']);
$xml->writeAttribute('quantity', $row['quantity']);
$xml->writeAttribute('date', $row['date']);
$xml->writeAttribute('pending', $row['pending']);