html - how to delete a file with symbols (Specifically the apostrophe) -


i have database stores teams. each of these team names unique. in event 1 named bob's team. have managed % encode symbols when sent through querystring next file. in file getting error sql due apostrophe , don't know how fix it. not quite sure escaping stuff i'm reading. it's pretty confusing. here line causing problem:

strsql = "select * teams teamname='" & theteamname & "'" 

in event bob's team name of team. error is:

microsoft ole db provider odbc drivers error '80040e14'  [microsoft][odbc microsoft access driver] syntax error (missing operator) in query expression 'teamname='bob's team''.  /deleteteam.asp, line 35 

i'd know have in order make delete team apostrophe (and possibly other annoying symbols) in it.

to make query work can try following:

replace in theteamname single quote ' '' use in query. (@least works in mysql not sure abt db engine give try).

note better use prepared statement prevent sql-injection


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -