在php中创建发票pdf时出错

时间:2015-07-17 16:11:26

标签: php sql fpdf

请帮助解决我创建一个简单的发票细节PHP代码的神话,如下所示....我有2个表作为“a_sales”和“a_sales_detail”,我尝试创建发票pdf。现在它根本不显示.....

<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="panel panel-default">
 <div class="panel-heading">Item Information</div>
 <div class="panel-body">
 <?php
 $sql = "SELECT DISTINCT ";
 "`a_sales_detail`.`Sales_Quantity` AS `OrderQTY`,";
 "`a_sales_detail`.`Stock_Item` AS `Item`,";
 "`a_sales_detail`.`Item_Description` AS `Description`,";
 "`a_sales_detail`.`Sales_Price` AS `UnitPrice`";
 "`a_sales_detail`.`Sales_Total_Amount ` AS `Subtotal`";

 " FROM ` a_sales ` JOIN `a_sales_detail ` ON (`a_sales`.`Sales_Number` = `a_sales_detail`.`Sales_Number`)";

 echo $dbhelper->ExecuteHtml($sql, array("fieldcaption" => TRUE, "tablename" => array("a_sales", "a_sales_detail"))); 
?>

1 个答案:

答案 0 :(得分:0)

$ sql简单地分配了“SELECT DISTINCT”而没有别的。您可能希望用该点替换该行后面的分号,因为您希望以下行也是该SQL语句的一部分。可能需要更多的替代品。

您应该在PHP中检查何时使用点而不是分号。