Link to home
Start Free TrialLog in
Avatar of sasha85
sasha85

asked on

error:Expected end of statement

what is wrong here:
 mySQL="UPDATE demo SET filed=1 WHERE id = " & deletionList[i]

?

dim ppermit,deletionList
ppermit=request.form("fordeletion")
 
If ppermit<>"" then
 
deletionList = Split("deletionList", ", ")
dim mySQLp, conntempp, rstempp
For i=0 To UBound(deletionList)
  mySQLp="UPDATE demo SET filed=DATE_ADD(LOCALTIME(),INTERVAL 420 minute) WHERE id = " & deletionList[i]
 call updateDatabase(mySQLp, rstempp, "modipexe.asp") 
 response.redirect "opo.asp"
Next
 
End if

Open in new window

Avatar of sasha85
sasha85

ASKER

there will be always new query because i am using FOR...then i need to give each one spacial name:
For i=0 To UBound(deletionList)
  mySQLp & i="UPDATE demo SET filed=1 WHERE id = " & deletionList[i]
 call updateDatabase(mySQLp & i, rstempp & i, "modipexe" & i)
Next

and that not working as well...i got syntax error
what is deletionList[i]? is it a field or any control in form?
if it is a field name, you should use [tablename].[fieldname]
You also should write Next i
Avatar of sasha85

ASKER

deletionList is a list of id's...
for example
deletionList= 1, 2, 3, 4
Avatar of b0lsc0tt
sasha85,

What if you don't use the For and just run it 1 time?  Do you still get the error?

What is the code for updateDatebase()?  That may be the place with the error.  If you copy the subroutine in to the loop and use it that way what is the result?

Let me know if you have any questions or need more information.

b0lsc0tt
Avatar of sasha85

ASKER

if i am using this one time(no array) its working...
but here is the all code:
(this kind of double question now...cause another question i posted got into this same point...)
i will be be glad if you follow me to
https://www.experts-exchange.com/questions/23135462/posting-checkboxes.html
:)

dim ppermit,deletionList
ppermit=request.form("fordeletion")
 
If ppermit<>"" then
 
deletionList = Split("ppermit", ", ")
dim mySQLp, conntempp, rstempp
For i=0 To UBound(deletionList)
  mySQLp="UPDATE mmo SET filed=1 WHERE id = " & deletionList(i)
 call updateDatabase(mySQLp, rstempp, "modipexe") 
Next
 
End if
 
 
----
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
 
[MySQL][ODBC 3.51 Driver][mysqld-4.1.21-community-nt]Unknown column 'ppermit' in 'where clause' 

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jarw
jarw

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sasha85

ASKER

looking good!:)