Python防止SQL注入

注意这条sql语句
Python防止SQL注入
select * from goods where name=’ ’ or 1=1 or ‘1’

name = 空 但是 1确实等于1 所以 会查出所有信息

重点怎么防止SQL注入呢

Python防止SQL注入
让 execute 自动拼接字符串 就行了