psycopg2.errors.SyntaxError: syntax error at or near "Ronaldo"
LINE 7: ... VALUES (Cristiano Ronaldo, '...
import psycopg2
with connection.cursor() as cursor:
cursor.execute(
f"""INSERT INTO data(photo_avatar,
name,
type,
reach,
engagemant_er,
engage_percent)
VALUES ({profile_name}, 'N\A', {reach}, {engagement}, {engage_per});"""
)
connection.commit()
import psycopg2
E = lambda field: f'$myseckey${field}$myseckey$' if type(field) is str else field
with connection.cursor() as cursor:
cursor.execute(
f"""INSERT INTO data(photo_avatar,
name,
type,
reach,
engagemant_er,
engage_percent)
VALUES ({E(profile_name)}, 'N\A', {E(reach)}, {E(engagement)}, {E(engage_per));"""
)
connection.commit()
cursor.execute("insert into data(name, type) values (?,?)", (profile_name, "N/A"))