0

I have been using this site to build a simple link counter.

When I insert their code to create the columns, it won't work and displays the following error:

error #1064.

id INT AUTO_INCREMENT NOT NULL PRIMARY_KEY, clicks INT

Any idea what I am doing wrong?

Community
  • 1
  • 1
Qluvyy
  • 81
  • 1
  • 6

1 Answers1

0

Error 1064 means : "You have an error in your SQL syntax". It happens because

id INT AUTO_INCREMENT NOT NULL PRIMARY_KEY, clicks INT 

is not a valid SQL query at all. It's just the fields definition part.

To create your table, ensure you have a database selected and try:

CREATE TABLE IF NOT EXISTS `clickcount` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `click` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Bar-code
  • 277
  • 1
  • 6