Page 1 of 1

Best Method For New Record

Posted: Sun Jan 17, 2010 2:56 pm
by JakeJ
I've got a data entry form and when it's submitted, data gets entered in to the database. No problem there so far.

There are several tables with the primary table being 'client_details'. in which id is an autonumber field.

Quite a number of my variable depend on $id to perform their calculations, other queries, etc.

What is the best method for obtaining a new client id? My thought is that I write an otherwise blank record then do a max(id) query and assign it to $id but that seems a little clunky to me.

Oh, I've coded my form with a static variable for $id for now.

How would you do it?

Re: Best Method For New Record

Posted: Sun Jan 17, 2010 3:03 pm
by VladSun