Question

I'm trying to get this to work but I don't understand how SQL works outside of the basics. Can you find the error in this?

CREATE TABLE lil_urls (
  id varchar(255) NOT NULL default '',
  url text,
  date timestamp(14) NOT NULL,
  PRIMARY KEY  (id)
) TYPE=MyISAM;

I'm currently getting this error in PhPMyAdmin:

#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 '(14) NOT NULL,
  PRIMARY KEY  (id)' at line 4 

Thanks for your help!

Was it helpful?

Solution

Correct syntax is

CREATE TABLE lil_urls (
  id varchar(255) NOT NULL default '',
  url text,
  date timestamp NOT NULL,
  PRIMARY KEY  (id)
) ENGINE=MyISAM;

TYPE is no longer used and you need to use as ENGINE And no need to specify length for timestamp

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top