扫码关注官方订阅号
学习是最好的投资!
可以尝试不要自己拼SQL语句,利用系统库自带的函数,例如
results = cur.select(table = 'articles', columns = ['id','link','is_keywords_avaliable'], where = correct_parms) # 具体的参数我也记得不清楚,可以自己查查看。
利用格式化字符串可以方便地替换参数。
sql = "select {columns} from {table} {is_where} {condition}".format(columns = 'id, link, is_keywords_available', table = 'articles', is_where = "where", condition = ".....")
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
可以尝试不要自己拼SQL语句,利用系统库自带的函数,例如
利用格式化字符串可以方便地替换参数。