'Is there any way by which I can get mysql (python connector) column names from user input?
So, I wanted to create a program where it will take input from user about everything i.e. database name, table name, table structure(column names), data and then perform various add, delete, update etc. function on it. But I am unable to take column names as user input. I tried the following code:
name_table=input('ENter name of your table:')
table_structure=input('Enter the structure/row names of the table(seperated by commas):')
y.execute('create table '+name_table+''+table_structure+'')
print('Table', name_table, 'created successfully')
x.commit()
but unfortunately it always shows error
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
