Forums

This topic is locked

Duplicate entry '0' for key 1

Posted 30 Sep 2006 01:55:39
1
has voted
30 Sep 2006 01:55:39 Tracy Sweder posted:
I am attempting to setup a form that will allow me to add records to the database. The first field in the database is called "ID" and it is the primary key. According to the book I have (PHP Web Development with Macromedia Dreamweaver MX 2004 by Allan Kent and David Powers with Rachel Andrew) when I create the "Insert Record Server Behavior" it should show me that 'ID' is an Unused Primary Key and then whenever I submit the form the enter a new row in the database it should automatically generate the next number.

However - instead of generating the next number it only wants to generate '0'. Since I already have a row with the ID of 0 it of course is showing as a duplicate error whenever I try to add a new record. Any ideas on how to fix this?

Thanks,
Tracy

Replies

Replied 03 Oct 2006 19:00:48
03 Oct 2006 19:00:48 Tracy Sweder replied:
Nevermind - I needed to setup the field in the database to "autoincrement"

Reply to this topic