Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Retrieving the Auto-increment number?

Quote Reply
Retrieving the Auto-increment number?
I have a table setup with an auto-increment field (the PK). I am not using the "auto generated" forms (eg. calling the DbSQL::HTML:: template routines)... I'm creating my own form elements within the templates.

Question: How do I use this auto incremented field? Do I just leave it blank and let the database fill it in or do I need to query the database for the new ID number and insert it into my form that the user fills out?

When I just leave the field blank, I get this error "Cannot insert duplicate key in object 'Claims'". I can delete the exising record but then soon after I just get the same error. As if it is not incrementing the ID field. There seems to be very little documentation on this specific feature.
Subject Author Views Date
Thread Retrieving the Auto-increment number? LanceWilson2 2521 Feb 18, 2003, 1:48 PM
Thread Re: [LanceWilson2] Retrieving the Auto-increment number?
604 2395 Feb 28, 2003, 12:07 PM
Post Re: [TheStone] Retrieving the Auto-increment number?
LanceWilson2 2363 Mar 6, 2003, 8:23 AM