Man... I feel like such a noob. "Duplicate Key" e
Posted: Wed May 19, 2004 12:08 am
I don't think thats a bad thing, but nonetheless, I looked up the solution to this prob with no avail.
That stupid error of "duplicate key '0' in" or whatever came up.
DB:
Insert code:

That stupid error of "duplicate key '0' in" or whatever came up.
DB:
Code: Select all
CREATE TABLE `articles` (
`id` int(5) NOT NULL auto_increment,
`title` varchar(50) NOT NULL default '',
`body` text NOT NULL,
`author` varchar(40) NOT NULL default '',
`dateadd` datetime NOT NULL default '0000-00-00 00:00:00',
`rating` tinyint(2) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `rating` (`rating`),
KEY `author` (`author`),
FULLTEXT KEY `body` (`body`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;Code: Select all
$insert = mysql_query("INSERT INTO `articles` (`title`, `body`, `author`, `dateadd`) VALUES ('$title', '$body', '$author', NOW())");