Safe MySQL queries in vbscript -


im doing mysql operations in vbscript , im doing (not true vbscript code dont know syntax off top of head):

dim whereclause=textboxtext $dbexecute("connectionstring","delete table column='"+query+"'") 

obviously unsafe , destructive. there mysql function can pass in query make safer?

there no magic fairydust function automatically make statements harmless. user has permission delete records able delete records.

if you're concerned way build statement (using string concatenation), that's whole other story. sql injection can mitigated via prepared statements (or parameterized queries, microsoft calls them):

value = "..." connectionstring = "..."  set conn = createobject("adodb.connection") conn.open connectionstring  set cmd = createobject("adodb.command") set cmd.activeconnection = conn cmd.commandtext = "delete table column=?"  set p = cmd.createparameter("@p", 200, 1, 255, value) cmd.parameters.append p  cmd.execute 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -