MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Gary W. Smith Date:February 27 2009 2:02am
Subject:RE: [PHP] RE: non-auto increment question
View as plain text  
> Being rather new to all this, I understood from the MySql manual that
> the auto_increment is to b e used immediately after an insertion not
> intermittently. My application is for administrators (the site owner &
> designates) to update the database from and administration directory,
> accessed by user/password login... so there's really very little
> possibility of 2 people accessing at the same time.
> By using MAX + 1 I keep the id number in the $idIn and can reuse it in
> other INSERTS
> --

The statement is confusing at best.  For the casual user auto_increment
is the way to do.  I say for the casual user.  That is typical me and
you.  Basically if you do an insert a unique value is inserted at the
time of the insert.  As mentioned, there are ways to get this value back
in the return.  

Now why I say it's for the casual user is because if you are using
triggers then you can do things prior to this value being used and then
the statement above is correct.  But you are not going to be using
triggers...

So, put an auto_increment on the key field and find one of the 2^16
samples of how this works with PHP.
Thread
Re: [PHP] RE: non-auto increment questionPJ26 Feb
  • RE: [PHP] RE: non-auto increment questionJerry Schwartz26 Feb
  • RE: [PHP] RE: non-auto increment questionJerry Schwartz26 Feb
    • Re: [PHP] RE: non-auto increment questionPJ26 Feb
      • RE: [PHP] RE: non-auto increment questionJerry Schwartz26 Feb
  • RE: [PHP] RE: non-auto increment questionGary W. Smith27 Feb
RE: [PHP] RE: non-auto increment questionJerry Schwartz26 Feb
Re: [PHP] RE: non-auto increment questionPJ26 Feb
RE: [PHP] RE: non-auto increment questionJerry Schwartz26 Feb
Re: [PHP] RE: non-auto increment questionPJ11 Mar