当我使用XAMPP与php 7和Server版本:10.1.19时,将不会返回任何结果

时间:2017-06-13 06:11:00

标签: mysql mysqli xampp

我有两个版本的XAMPP

Apache / 2.4.4(Win32)OpenSSL / 0.9.8y PHP / 5.4.16

服务器类型:MySQL 服务器版本:5.5.32 - MySQL社区服务器(GPL)

协议版本:10

Apache / 2.4.23(Win32)OpenSSL / 1.0.2h PHP / 7.0.13

服务器类型:MariaDB 服务器版本:10.1.19-MariaDB - mariadb.org二进制发行版

协议版本:10

我有一个sql查询相同的DATABASE相同的sql查询当我使用xamp与php v 5.4.16和MySQL服务5.5.32它将返回2行,这是好的。

但问题是我需要使用其他xampp,因为它有最新的Php版本,我需要将myslq转换为mysqli cuz mysql 已经在php ver 5.5中弃用了。 但是当我在查询浏览器中使用我的sql查询时,即使使用相同的DATABASE和相同的SQL QUERY并且它没有给出任何错误,也不会返回任何行。

我不知道背后的问题是什么。希望你能指导并帮助我解决这个问题。

SELECT slsum.SL_BRCODE,loan.LoanTR_DATE,
     (SELECT CASE
        WHEN loan.LoanTERM_PERD = '1' THEN DATE_ADD(loan.LoanTR_DATE, INTERVAL loan.loanTERMS DAY)
        WHEN loan.LoanTERM_PERD = '2' THEN DATE_ADD(loan.LoanTR_DATE, INTERVAL loan.loanTERMS WEEK)
        WHEN loan.LoanTERM_PERD = '3' THEN DATE_ADD(loan.LoanTR_DATE, INTERVAL (loan.loanTERMS/2) MONTH)
        WHEN loan.LoanTERM_PERD = '4' THEN DATE_ADD(loan.LoanTR_DATE, INTERVAL loan.loanTERMS MONTH)
        WHEN loan.LoanTERM_PERD = '5' THEN DATE_ADD(loan.LoanTR_DATE, INTERVAL loan.loanTERMS QUARTER)
        WHEN loan.LoanTERM_PERD = '6' THEN DATE_ADD(loan.LoanTR_DATE, INTERVAL (loan.loanTERMS/2) YEAR)
        WHEN loan.LoanTERM_PERD = '7' THEN DATE_ADD(loan.LoanTR_DATE, INTERVAL loan.loanTERMS YEAR)
        END
    ) AS MDATE,
        slsum.SL_CLIENTID, slsum.SLE_CODE, slsum.SLC_CODE, slsum.SLT_CODE, CAST(CONCAT(sle_type.SLE_TypeDesc2,' : ', sltype.SLTypeM_DESC2) AS CHAR) AS SL_DESC, slsum.REF_NO, IF(slsum.SLC_CODE='13',
        (SELECT ARXXREF_NO FROM ar WHERE ar.ARBR_CODE = slsum.SL_BRCODE AND ar.ARSLC_CODE = slsum.SLC_CODE AND ar.ARSLT_CODE = slsum.SLT_CODE AND ar.ARREF_NO = slsum.REF_NO AND ar.ClientIDAR = slsum.SL_CLIENTID),IF(slsum.SLC_CODE = '12',
        (SELECT LoanXXREF_NO FROM loan WHERE loan.LoanBR_CODE = slsum.SL_BRCODE AND loan.LoanSLC_CODE = slsum.SLC_CODE AND loan.LoanSLT_CODE = slsum.SLT_CODE AND loan.LoanREF_NO = slsum.REF_NO AND loan.ClientIDLoan = slsum.SL_CLIENTID), NULL)) AS ARREFNO,
        slsum.TR_DATE, baltype.BalTypeIsDebit AS BAL_TYPE, IF(coa.COAacct_type = 4 OR coa.COAacct_type = 5 OR coa.COAacct_type = 6, 1, 0) AS SHOWTHIS,
        (SELECT sldtl.AMT FROM sldtl WHERE sldtl.SL_BRCODE = slsum.SL_BRCODE AND sldtl.SL_CLIENTID = slsum.SL_CLIENTID AND sldtl.SLC_CODE = slsum.SLC_CODE AND
        sldtl.SLT_CODE = slsum.SLT_CODE AND sldtl.REF_NO = slsum.REF_NO AND sldtl.SLE_CODE = slsum.SLE_CODE AND (sldtl.ADJ_FLAG = 1 OR sldtl.ADJ_FLAG = 2) LIMIT 1) AS SETUPAMOUNT,
        (SELECT SUM(AMT) * baltype.BalTypeIsDebit FROM sldtl WHERE sldtl.SL_BRCODE = slsum.SL_BRCODE AND sldtl.SL_CLIENTID = slsum.SL_CLIENTID AND sldtl.SLC_CODE = slsum.SLC_CODE AND sldtl.SLT_CODE = slsum.SLT_CODE AND sldtl.REF_NO = slsum.REF_NO AND sldtl.SLE_CODE = slsum.SLE_CODE
        AND sldtl.TR_DATE <= '23' AND sldtl.TR_DATE >= IF(baltype.BalTypeCutDate IS NULL, '0000-00-00',IF((MONTH(baltype.BalTypeCutDate) - 11)>0, '2016-01-01', CAST(CONCAT(IF('06' < MONTH(baltype.BalTypeCutDate + INTERVAL 1 DAY), 2016 - 1  , '2016'),'-',MONTH(baltype.BalTypeCutDate + INTERVAL 1 DAY),'-',DAY(baltype.BalTypeCutDate + INTERVAL 1 DAY)) AS CHAR)))) AS BALANCE,
        1, (SELECT SUM(HHELD_AMT) AS HOLDAMOUNT FROM hold WHERE HBR_CODE = slsum.SL_BRCODE AND HSLC_CODE = slsum.SLC_CODE AND HSLT_CODE = slsum.SLT_CODE AND HREF_NO = slsum.REF_NO AND ClientIDH = slsum.SL_CLIENTID) AS HOLDAMOUNT, (SELECT ABS(SUM(AMT)) FROM sldtl WHERE sldtl.SL_BRCODE = slsum.SL_BRCODE AND
        sldtl.SL_CLIENTID = slsum.SL_CLIENTID AND sldtl.SLC_CODE = slsum.SLC_CODE AND sldtl.SLT_CODE = slsum.SLT_CODE AND sldtl.REF_NO = slsum.REF_NO AND sldtl.SLE_CODE = slsum.SLE_CODE AND sldtl.TR_DATE <= '23' AND sldtl.CLRG_DAYS<>0) AS UNCLEAREDCHECKAMOUNT,
        IF(slsum.SLC_CODE = '12', (SELECT IF(loan.LoanMAT_DATE IS NOT NULL AND loan.LoanMAT_DATE <= '23','PASTDUE','NA') AS MAT_STATUS FROM loan WHERE slsum.SL_BRCODE = loan.LoanBR_CODE AND slsum.SLC_CODE = loan.LoanSLC_CODE AND slsum.SLT_CODE = loan.LoanSLT_CODE AND slsum.REF_NO = loan.LoanREF_NO AND slsum.SL_CLIENTID = loan.ClientIDLoan),
        IF(slsum.SLC_CODE = '23', (SELECT IF(ar.ARMAT_DATE IS NOT NULL AND ar.ARMAT_DATE <= '23','PASTDUE','NA') AS MAT_STATUS FROM ar WHERE slsum.SL_BRCODE = ar.ARBR_CODE AND slsum.SLC_CODE = ar.ARSLC_CODE AND slsum.SLT_CODE = ar.ARSLT_CODE AND slsum.REF_NO = ar.ARREF_NO AND slsum.SL_CLIENTID = ar.ClientIDAR),'NA')) AS MATDATE
        FROM slsum
        LEFT JOIN glcontrol ON glcontrol.GLControlBR_CODE = slsum.SL_BRCODE AND glcontrol.GLControlSLC_CODE = slsum.SLC_CODE AND glcontrol.GLControlSLT_CODE = slsum.SLT_CODE AND glcontrol.GLControlSLE_CODE = slsum.SLE_CODE
        LEFT JOIN baltype FORCE INDEX(PRIMARY) ON baltype.BalTypeID = glcontrol.BAL_TYPE
        LEFT JOIN sltype FORCE INDEX(PRIMARY) ON sltype.SLTypeBR_CODE = slsum.SL_BRCODE AND sltype.SLTypeSLC_CODE = slsum.SLC_CODE AND sltype.SLTypeSLT_CODE = slsum.SLT_CODE
        LEFT JOIN sle_type ON sle_type.SLE_TypeCode = SLE_CODE AND INSTR(sle_type.SLE_TypeActive,CONCAT(SLC_CODE)) <> 0
        LEFT JOIN coa ON coa.COABR_CODE = glcontrol.GLControlBR_CODE AND coa.COAID = glcontrol.GLControlACCT_CODE
        LEFT JOIN loan ON loan.LoanBR_CODE = slsum.SL_BRCODE AND loan.LoanSLC_CODE = slsum.SLC_CODE AND loan.LoanREF_NO = slsum.REF_NO AND loan.ClientIDLoan = 13 AND loan.loanSLT_CODE = slsum.SLT_CODE
        WHERE slsum.SL_BRCODE = '12' AND slsum.SL_CLIENTID = '13' AND (slsum.SLE_CODE = '11' OR (slsum.SLC_CODE = '12' AND slsum.SLE_CODE = '21'))
        AND sltype.SLTypeIsIncSOA = 1 GROUP BY SL_BRCODE, SLC_CODE, SLT_CODE, REF_NO, SLE_CODE HAVING (BALANCE<>0 AND BALANCE IS NOT NULL) OR SHOWTHIS = 1

0 个答案:

没有答案