Hi,
What do you do if you want to search for someones surname if it is something like O'brian etc.
For instance the sql where clause is:
WHERE surname = 'o'brian'
would be incorrect.
It returns an error of Incorrect syntax near 'brian' because of the '.
I use
in asp javascript to save the surname correctly to the database, but the same regexp won't work for an sql statement's where clause.
What do you do if you want to search for someones surname if it is something like O'brian etc.
For instance the sql where clause is:
WHERE surname = 'o'brian'
would be incorrect.
It returns an error of Incorrect syntax near 'brian' because of the '.
I use
Code:
surname = surname.replace(/\'/g,"''");