Alright, so I’m getting the error:
#1062 - Duplicate entry '0' for key 'PRIMARY'
on this table:
CREATE TABLE links (
ID smallint(6) NOT NULL default '0',
Position smallint(6) NOT NULL default '0',
Name text NOT NULL,
url text NOT NULL,
IP text NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
using this command:
INSERT INTO links(Position, Name, url, IP) VALUES(0, "Google", "http://www.google.com", "0.0.0.0")
The table is only has one row in it, so why the heck isn’t the auto increment working? :<
You’re not actually defining the
IDcolumn as an auto-increment column. Also, aDEFAULTvalue doesn’t make sense for an auto incrementing column either.Your id column should be:
More info here: http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html