KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've created a table "table2" and get warnings (table already exists) when I run my code. I want to create the table only if it doesn't exist. Some research MySQL syntax website turns up the following in MySQL : CREATE TABLE IF NOT EXISTS My code: cursor.execute('CREATE TABLE IF NOT EXISTS (2 INT)`table2`') provides this warning: _mysql_exceptions.ProgrammingError: (1064, "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 '(2 INT)`table2`' at line 1") I have database version Database version : 5.1.54-1ubuntu4 Thanks-Tom
Tags (comma-separated)
Save Edits
Cancel