I want to create table name with a one column but I'm getting this error:
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test' 'int')' at line 1
The code I'm trying to use:
table_name = 'test'
create_table = f'CREATE TABLE {table_name} (%s %s)'
cursor.execute(create_table,(headers[0], data_types[0],))
I've tried typing manually table name, column name and data type but it ended up with the same result. I've seen a lot of solutions on this problem but none of them worked out with this case
headers[0]anddata_types[0], otherwise it's hard to guess the query you submitheaders[0] == 'test'anddata_types[0] == 'int'. I've got my answer already but thank you for trying to help