|
|
|
รบกวนด้วยนะค่ะ เขียนคำสั่ง sql แล้ว Error ช่วยด้วยนร้าคร้า |
|
|
|
|
|
|
|
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Report For APC</title>
</head>
<body>
<?
$conn = @mysql_connect("localhost","root","1234");
mysql_select_db('apcreport',$conn);
$result = mysql_query('SELECT BCARINVOICE.ArName,BCCreditNoteSub.DocDate,BCARINVOICESUB.SaleCode,BCARINVOICESUB.Qty,BCARINVOICESUB.Price,BCARINVOICESUB.NetAmount, BCARINVOICESUB.ItemCode,BCARINVOICESUB.SumofCost,BCItemGroup1.Name, BCARINVOICE.DocDate,BCCreditNoteSub.DiscQty,BCCreditNoteSub.BillQty,BCARINVOICESUB.UnitCode,BCCreditNoteSub.NetAmount FROM BCARINVOICE INNER JOIN BCARINVOICESUB ON BCARINVOICE.DocNo = BCARINVOICESUB.DocNo INNER JOIN BCItemGroup1 ON BCARINVOICESUB.GroupCode = BCItemGroup1.Code LEFT OUTER JOIN BCCreditNoteSub ON BCARINVOICESUB.DocNo = BCCreditNoteSub.InvoiceNo BETWEEN '2011-01-1' AND '2011-08-31'',$conn);
if(!$result)
printf("พบข้อพิดพลาดเนื่องจาก %s",mysql_error($conn));
else
printf("พบจำนวนข้อมูลจำนวน %s แถว ",mysql_num_rows($result));
?>
</body>
</html>
Error
Parse error: syntax error, unexpected T_LNUMBER in C:\AppServ\www\phpmydream\phpmydream.php on line 11
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2011-09-22 09:56:07 |
By :
confusion |
View :
813 |
Reply :
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
$result = mysql_query(" SELECT BCARINVOICE.ArName,BCCreditNoteSub.DocDate,BCARINVOICESUB.SaleCode,BCARINVOICESUB.Qty,BCARINVOICESUB.Price,BCARINVOICESUB.NetAmount, BCARINVOICESUB.ItemCode,BCARINVOICESUB.SumofCost,BCItemGroup1.Name, BCARINVOICE.DocDate,BCCreditNoteSub.DiscQty,BCCreditNoteSub.BillQty,BCARINVOICESUB.UnitCode,BCCreditNoteSub.NetAmount FROM BCARINVOICE INNER JOIN BCARINVOICESUB ON BCARINVOICE.DocNo = BCARINVOICESUB.DocNo INNER JOIN BCItemGroup1 ON BCARINVOICESUB.GroupCode = BCItemGroup1.Code LEFT OUTER JOIN BCCreditNoteSub ON BCARINVOICESUB.DocNo = BCCreditNoteSub.InvoiceNo BETWEEN '2011-01-1' AND '2011-08-31' ");
ใช้แบบนี้ครับ
|
|
|
|
|
Date :
2011-09-22 17:52:22 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เคยเขียนภาษา C มาก่อนเหรอครับเห็นใช้
printf ไม่ค่อยเห็นคนใช้กันใน php
|
|
|
|
|
Date :
2011-09-22 18:15:50 |
By :
adaaugusta |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใช้ค่ะ บรรทัดนั้นแระค่ะ หนู query ใน sql แล้วมันได้อ่ะค่ะ
|
|
|
|
|
Date :
2011-09-23 08:41:59 |
By :
confusion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf เป็นการเขียน php ค่ะ
|
|
|
|
|
Date :
2011-09-23 08:42:59 |
By :
confusion |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|