I keep getting "Duplicate entry '0' for key 'PRIMARY'" when running the following SQL command from a PHP script:
INSERT INTO Backgrounds (user, url)
VALUES ('$user', '$bgrequest')
And here is the code that generates the table below. The first insert works, but all subsequent requests do not. I have tried deleting the table and recreating, still no luck. Also when I insert a row from phpmyadmin, it works and increments without issue. For some reason it just doesn't seem to autoincrement when running the command from a PHP script...
CREATE TABLE `freestylefriday`.`Backgrounds` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`user` VARCHAR( 255 ) NOT NULL ,
`url` VARCHAR( 1000 ) NOT NULL
) ENGINE = MYISAM
Such a simple table and request... driving me crazy.