$query2 = oci_parse($conn, 'SELECT A."T$BPID" FROM ttccom100210 A WHERE A."T$BPID" = (SELECT MAX(B."T$BPID") FROM ttccom100210 B WHERE B."T$BPID" LIKE '%C')');
ขึ้น error ดังนี้จ้า
syntax error, unexpected '')'' (T_CONSTANT_ENCAPSED_STRING) in C:\xampp\htdocs\report\option.php on line 4
ขอบคุณล่วงหน้าน่ะ
Tag : PHP, Oracle
Date :
2015-03-30 11:08:20
By :
ponkung
View :
714
Reply :
5
No. 1
Guest
ตามที่ error ครับ
Code (PHP)
$query2 = oci_parse($conn, 'SELECT A."T$BPID" FROM ttccom100210 A WHERE A."T$BPID" = (SELECT MAX(B."T$BPID") FROM ttccom100210 B WHERE B."T$BPID" LIKE \'%C\')');
$query = 'SELECT
A.T$BPID AS CUSTID,
A.T$NAMA AS CUSTDESC,
A.T$SEAK AS CUSTDESC1,
TRIM(B.T$LN02) AS ADDRESS,
B.T$LN03 AS LN03,
B.T$LN04 AS LN04,
B.T$LN05 AS LN05,
SUBSTR (A.T$BPID,2,2) AS CUSTWHS,
C.T$SOTP,
TRIM(C.T$CPLS) AS PRICEGP,
D.T$CRLR AS CRADITLIM,
SUBSTR (D.T$CPAY,2,2) AS CREDITERN,
A.T$SNDR AS NEW_CUST
FROM ttccom100100 A
JOIN ttccom130100 B ON A.T$CADR = B.T$CADR
JOIN ttccom110100 C ON A.T$BPID = C.T$OFBP
JOIN ttccom112100 D ON A.T$BPID = D.T$ITBP
WHERE A.T$PRST = 2 AND A.T$BPRL = 2
AND (A.T$BPID BETWEEN '.$business_from.' AND '.$business_to.')
ORDER BY A.T$BPID ASC';
$objParse = oci_parse ($conn, $query);
oci_execute ($objParse,OCI_DEFAULT);
$query = <<<SQL
SELECT
A.T\$BPID AS CUSTID,
A.T\$NAMA AS CUSTDESC,
A.T\$SEAK AS CUSTDESC1,
TRIM(B.T\$LN02) AS ADDRESS,
B.T\$LN03 AS LN03,
B.T\$LN04 AS LN04,
B.T\$LN05 AS LN05,
SUBSTR (A.T\$BPID,2,2) AS CUSTWHS,
C.T\$SOTP,
TRIM(C.T\$CPLS) AS PRICEGP,
D.T\$CRLR AS CRADITLIM,
SUBSTR (D.T\$CPAY,2,2) AS CREDITERN,
A.T\$SNDR AS NEW_CUST
FROM ttccom100100 A
JOIN ttccom130100 B ON A.T\$CADR = B.T\$CADR
JOIN ttccom110100 C ON A.T\$BPID = C.T\$OFBP
JOIN ttccom112100 D ON A.T\$BPID = D.T\$ITBP
WHERE A.T\$PRST = 2 AND A.T\$BPRL = 2
AND (A.T\$BPID BETWEEN '$business_from' AND '$business_to' )
ORDER BY A.T\$BPID ASC
SQL;