If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > .update with mySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-09-04, 16:42
jgoodpasture jgoodpasture is offline
Registered User
 
Join Date: Jan 2004
Posts: 1
Thumbs down .update with mySQL

Please help. I have this code that worked fine in MS SQL. Now I just ported over to mySQL and it is changing the fields I update maybe the first time and deleting all others. Then another time it may hang until it times out. But it changes what I originally changed and deleting all others as well.

The first page is simply a form that pulls records from the db and displays then in a form. The name in each row is "price" + counter as in price1, price2, price3 etc...

now here is the exec code on the second page.

<%'Modify Prices Exec%>
<%
'includes deleted for this post
' get settings
pDecimalSign = getSettingKey("pDecimalSign")
pChangeDecimalPoint = getSettingKey("pChangeDecimalPoint")
pVendorCode =request.form("pVendor")

dim mySQL, connTemp, rstemp, counter
counter = 1

'get all values in current vendor ID
mySQL="SELECT sku,idProduct, price, listPrice, bToBPrice, cost FROM products WHERE idSupplier=" &pVendorCode &" ORDER BY sku"
call getFromDatabaseUpdate(mySQL, rstemp, "bulkUpdatePricesExec.asp")

do while not rstemp.eof

pIdProduct = request.form("idProduct" & counter)

if (pIdProduct = rstemp("idProduct")) then
response.redirect "message.asp?message="& Server.Urlencode("ERROR - Product ID's do not match!-" &pIdProduct &"-"& rstemp2("idProduct")&"-")
end if


pCostPrice = request.form("cost" & counter)
pCostPrice = money(pCostPrice)

pListPrice = request.form("list" & counter)
pListPrice = money(pListPrice)

pPrice = request.form("price" & counter)
pPrice = money(pPrice)

pClubPrice = request.form("club" & counter)
pClubPrice = money(pClubPrice)


With rstemp
.Fields("price") = pPrice
.Fields("listPrice") = pListPrice
.Fields("bToBPrice") = pClubPrice
.Fields("cost") = pCostPrice
.Update
End With

counter = counter + 1

rstemp.MoveNext
Loop
%>


Please tell me if there is a way around this ? Is this a mySQL problem?? What do you suggest PLEASE??


Thanks ~ Jonathan
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On