EMail\SQLError

G

gh

Below is the from part of an sql statement. When the query is fired
from the web page I get the following error. How do I work around this?

Thanks




Token unknown - line 1, char 67 @




from USERLOGIN WHERE LOGIN= " +aEmail+ " AND PSSWORD=
 
H

Hilmar Bunjes

gh said:
Below is the from part of an sql statement. When the query is fired
from the web page I get the following error. How do I work around this?

Thanks

Token unknown - line 1, char 67 @

from USERLOGIN WHERE LOGIN= " +aEmail+ " AND PSSWORD=

You should use a prepared statement or a stored procedure. The way you
build the sql command is open to sql injection. Just think what'll
happen is "aEmail" is: ..."; delete from userlogin;"... or something
like that.

Best,
Hilmar
 
A

Augustin Prasanna

try using single quotes around the variable in your where clause

example:

from USERLOGIN WHERE login ='" + aEmail + "'

I assume, aEmail is a string variable in your .net code.

Regards,
Augustin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top