Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mysql error #1064

I am trying to create some tables on phpMyAdmin, but when I use the code below I am getting this error:

#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 '(32) NOT NULL,

activated enum(0,1) NOT NULL, PRIMARY KEY (id) ) E' at line 8

Here is my code:

    CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `first_name` varchar(255) NOT NULL,
  `last_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `sign_up_date` date(32) NOT NULL,
  `activated` enum(`0`,`1`) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=1atin1 AUTO_INCREMENT=1 ;
like image 290
theoko Avatar asked Mar 28 '26 05:03

theoko


1 Answers

Try following code. I have resolved your mistakes in code

CREATE TABLE IF NOT EXISTS `users` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `username` varchar(255) NOT NULL,
      `first_name` varchar(255) NOT NULL,
      `last_name` varchar(255) NOT NULL,
      `email` varchar(255) NOT NULL,
      `password` varchar(255) NOT NULL,
      `sign_up_date` date NOT NULL,
      `activated` enum('0','1') NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
like image 107
Bhumi Shah Avatar answered Mar 29 '26 19:03

Bhumi Shah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!