itsmeadrean Posted January 23, 2014 Share Posted January 23, 2014 <?php include("../../connect.php");$burger=$row['event_name']; $query=mysql_query("CREATE TABLE $burger (id int(10) AUTO_INCREMENT,event_id char(50), name char(100))")or die (mysql_error()); ?> error : Incorrect table definition; there can be only one auto column and it must be defined as a key Quote Link to comment Share on other sites More sharing options...
itsmeadrean Posted January 23, 2014 Author Share Posted January 23, 2014 anyone?? Quote Link to comment Share on other sites More sharing options...
Mace Posted January 23, 2014 Share Posted January 23, 2014 It says you have to set a key is you want to use auto increment. In this case you want to make it a primary key. CREATE TABLE `$burger` ( `id` INT NOT NULL AUTO_INCREMENT, `event_id` CHAR(50) NOT NULL DEFAULT '0', `name` CHAR(100) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) COLLATE='utf8_unicode_ci'; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.