This topic is locked
[SOLVED]

 Auto Incrementing the DB Record id with PHP Runner?

2/9/2006 10:14:22 AM
PHPRunner General questions
C
ctsmgr author

I am stumped on how to set up my web forms that add. I set up the record id as a unique field but it does not auto increment like in my DB control application.
http://www.polarisbsa.org/events/daycamp/scouts_add.php is an example. I need to know how to use php runner to set up an auto increment on the id field.
This application goes live in just over a week and I need to make this adjustment.
Thanks,
Michael

jimhnet 2/9/2006

I am stumped on how to set up my web forms that add. I set up the record id as a unique field but it does not auto increment like in my DB control application.

http://www.polarisbsa.org/events/daycamp/scouts_add.php is an example. I need to know how to use php runner to set up an auto increment on the id field.
This application goes live in just over a week and I need to make this adjustment.
Thanks,
Michael


Michael:
Set auto_increment in mysql(its a function the db manager) and don't put the id record in the add screen. You are trying to increment the record number before you submit, which would create concurrency issues.
The number should only be incremented on record write.
Jim

C
ctsmgr author 2/9/2006

It looks like that worked if I set up an auto increment on the DB field and do not allow an add or edit on the add pages.
Thanks!
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7939&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' /> Michael

jimhnet 2/11/2006

It looks like that worked if I set up an auto increment on the DB field and do not allow an add or edit on the add pages.

Thanks!
<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=7959&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' /> Michael


You need to display it on the edit and other pages, but it works fine in add mode wherever, what happens is the db manager is incrementing the number when you add a new record. I make it the primary key also.
Jim F