联盟二桌

时间:2016-09-20 02:21:05

标签: php mysql

  

我将两张表联合起来发票表和edit_invoice_request   这是我的代码,但它给我这样的错误

错误:警告:mysqli_num_rows()要求参数1为mysqli_result,给定布尔值。

  $invoice=mysqli_query($link,"Select SUM(INVOICE_ITEM_AMOUNT_MX) AS value_sum,INVOICE_NO_MX, INVOICE_DATE_MX,INVOICE_SALES_REP_MX, INVOICE_CUSTOMER_NAME,SUM(INVOICE_ITEM_QTY_MX) AS value_item ,INVOICE_STATUS_MX,REFUND_STATUS_MX,   INVOICE_NO_MX as invoiceno,BRANCH_CODE_MX as branch

    from invoice 

    UNION ALL

    select BRANCH_CODE_MX AS branch  from edit_invoice_request 

    where branch ='".$display_branchcode."'   GROUP BY INVOICE_NO_MX");

0 个答案:

没有答案