Answer the question
In order to leave comments, you need to log in
INSERT psycopg2 error occurs?
def set_user_info(id, fio, phone, registration):
conn = try_connect()
cursor = conn.cursor()
try:
cursor.execute(
"INSERT INTO user_info (id, fio, phone, registration) "
"VALUES (%d, %s, %s, TRUE)", (id, fio, phone, registration))
conn.commit()
conn.close()
cursor.close()
print('Запись user создана')
except:
print('Ошибка создания записи user')
print('Завершение создания записи user')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question