postgresql 如何插入含 ‘ 数据?
高洛峰
高洛峰 2016-10-22 17:02:48
0
1
830
cur.execute("UPDATE scholars SET name='{}' WHERE id={} and name is null".format(author, scholar_id))
psycopg2.ProgrammingError: syntax error at or near "Neill"LINE 1: UPDATE scholars SET name='O'Neill, Kevin' WHERE id=12403 and...

数据应该是:O'Neill, Kevin

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

répondre à tous(1)
三叔
cur.execute(
    """UPDATE scholars SET name = %s WHERE id = %s and name is null""", (author, scholar_id))


Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!