query with "special" character to save

srdva59

Active member
Joined
Feb 21, 2009
Messages
28
Programming Experience
Beginner
hi,
i need perform the following query to save into db the problem is sometimes the user
enter some characteres that interfer with the sql command for example

if the user enter this word: 'hello'
when i try save this result i error because the final query is this:

insert into x (v) values (''hello'') and for update this problem ocorr to
how can i save the value ' to the db replacing the ' charater for other?
thanks a lot for your help :)
 
if that doesn't work then you could always use the Replace method
Please don't advise newbies to do that: People are inherently lazy and when faced with the choice of upgrading their code to use proper parameterized SQLs, vs running a replacement of ' to '', they will pick the latter. While this seems to solve their problem it only teaches them a bad habit that they will persist with
 
your right cjard -- my bad
I edited my post so that hopefully i haven't negatively influenced too many people
 
Back
Top