Re: auto_increment and last_insert_value()

2001-02-19 Thread Minh Dam
Hi Doug, Try to use insert into player_table(playerid, player_name) values (auto, '$player_name); Cheers, Minh Dam On Mon, 19 Feb 2001, Doug Linley wrote: > I have a table that I created that has a primary key field that should be > auto_incremented. To fill in this value I am calling > >

RE: auto_increment and last_insert_value()

2001-02-19 Thread Quentin Bennett
Hi, Your are using LAST_INSERT_ID wrong. You should just do: insert into player_table(player_name) values ('$player_name'); And then use LAST_INSERT_ID to find out what player_id was assigned. Although "LAST_INSERT_ID() + 1" will give you "your last value +1", another client might already have

Re: auto_increment and last_insert_value()

2001-02-19 Thread Fred van Engen
On Mon, Feb 19, 2001 at 05:33:00PM -0500, Doug Linley wrote: > I have a table that I created that has a primary key field that should be > auto_incremented. To fill in this value I am calling > > insert into player_table(playerid, player_name) values (LAST_INSERT_ID() + > 1, '$player_name'); >

RE: auto_increment and last_insert_value()

2001-02-19 Thread Cal Evans
If you have the field set as auto_increment the you don't need to do anything else. Let nature take it's course. :) try: insert into player_table(player_name) values ('$player_name'); Cal http://www.calevans.com -Original Message- From: Doug Linley [mailto:[EMAIL PROTECTED]] Sent: Mon

Re: auto_increment and last_insert_value()

2001-02-19 Thread btjones
If playerid is an auto_increment field, then either of these work -- INSERT INTO player_table(player_name) VALUES ('$player_name'); INSERT INTO player_table(playerid, player_name) VALUES (NULL,'$player_name'); "Doug Linley" <[EMAIL PROTECTED]> wrote: I have a table that I created that has a