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

sasha85Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sasha85Author Commented:
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
0
sonchoyCommented:
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
0
sasha85Author Commented:
deletionList is a list of id's...
for example
deletionList= 1, 2, 3, 4
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

sasha85Author Commented:
0
b0lsc0ttIT ManagerCommented:
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
0
sasha85Author Commented:
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
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_23135462.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

0
jarwCommented:
A couple of possibilities here. First, don't put your variable name in double quotes in the Split function. You are attempting to split the string "ppermit" instead of the string STORED in the variable ppermit.

Secondly, if ppermit contains a comma-separated list of IDs, try getting rid of the Split stuff and the For loop altogether and just use this SQL statement:

mySQLp="UPDATE mmo SET filed=1 WHERE id IN(" & ppermit & ")"

So your resulting query would look something like this, and make all the updates you want to make with a single trip to the database:

UPDATE mmo SET filed=1 WHERE id IN(1, 2, 3, 4)

The complete code from your example is shown below with these modifications.
dim ppermit
ppermit=request.form("fordeletion")
 
If ppermit<>"" then
   dim mySQLp, conntempp, rstempp
   mySQLp="UPDATE mmo SET filed=1 WHERE id IN(" & ppermit & ")"
   call updateDatabase(mySQLp, rstempp, "modipexe") 
End if

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sasha85Author Commented:
looking good!:)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.