 |
|
แก้ไขข้อมูล ในตะกร้าไม่ได้
ยกตัวอย่างนะคะ สินค้า a แก้ไขจำนวนจาก 50 เป็น 100 ปรากฏว่ามันไปเป็น 100 ของ สินค้าอื่น ที่ไม่ใช่ a นะคะ ช่วยดูโค้ดให้ด้วยนะคะ
num=request.Form("num") 'จำนวน 100, 1, 1, 500, 500
eachNum=split(num,", ")
id=request.form("ver") 'รหัส G001, M001, M001, Pb001, Pb001
eachid=Split(id,",")
price=request.form("price") ' ราคา 30, 6000, 6000, 160, 160
eachprice=Split(price,",")
for j=0 to Ubound(eachNum)
ying = eachid(j)
dim rs6,sql6
set rs6 = Server.createObject("ADODB.Recordset")
sql6="select * from shop s,product p where s.sale_id='"&session("sale_id")&"' and s.id ='"& ying &"' and s.id=p.id "
rs6.Open sql6,conn,1,3
if not rs6.eof then
dim rs5,sql5
set rs5 = Server.createObject("ADODB.Recordset")
sql5="select * from shop where sale_id='"&session("sale_id")&"'"
rs5.Open sql5,conn,1,3
if not rs5.eof then
rs5.Fields("num")= eachNum(j)
rs5.Fields("total_price")= eachNum(j) * trim(rs6("price"))
rs5.Update
rs5.MoveNext
rs6.MoveNext
end if
end if
Next
จะกรุณาแก้โค้ดให้ก็จะดีนะคะ
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2 พ.ย. 2548 15:29:10 |
By :
แกงเลียง |
View :
2385 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |