문제

I am using a variable to interpolate in ASP, for this i have an vairable:

cid=Request.Form("customerID")  

and then,

rs.open "SELECT * FROM customers WHERE customerID='" & cid & "'",conn  

the above statement does not work.
while this works:

rs.open "SELECT * FROM customers WHERE customerID=1",conn  

can someone please help me???

도움이 되었습니까?

해결책

you code is wide open for a SQL injection!!!

read about parametrized queries.

in your first SQL you have apostrophes (') which is bad if cid is a number

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top