SQLite parameter substitution and quotes

前端 未结 6 1071
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 14:41

I have this line that works OK:

c.execute(\'select cleanseq from cleanseqs WHERE newID=\"%s\"\'%name)

But I want to use SQLite parameter su

6条回答
  •  半阙折子戏
    2020-11-28 15:11

    Regular User

    just noticed that you'll have to do this manual by using the unsecure method of sql_string = "other sql surger here.. fieldname=\""+value+"\";"

    its the only way you'll get it to parse correctly. using SQLite for win ce. and well left me with no other alternative, just escape your values before putting them in else you'll most likely end up with a very sad database from sql injections :'( lol

提交回复
热议问题