Re: [PHP] Getting last record ID created from DB

2007-03-19 Thread Richard Lynch
On Fri, March 16, 2007 10:28 pm, Jeff wrote: Is there a way to get the last Record # created by the DB. Yes, but... Example: User_ID = auto_increment f_name = varchar l_name = varchar e-mail = varchar b_date = varchar pic = varchar Since user_id is an auto_inc field I submit it as a

Re: [PHP] Getting last record ID created from DB

2007-03-19 Thread Richard Lynch
On Fri, March 16, 2007 10:37 pm, Rod Person wrote: select user_id from t_users where user_id = (select max(user_id) from t_users) Noo! This is a race condition Imagine, if you will, that *TWO* users sign up and create characters on your site at the exact same time: Lee

Re: [PHP] Getting last record ID created from DB

2007-03-17 Thread Mark
Rod Person wrote: On Fri, 16 Mar 2007 22:28:54 -0500 Jeff [EMAIL PROTECTED] wrote: Is there a way to get the last Record # created by the DB. $query = INSERT INTO `t_users` (`user_id`, `f_name`, `l_name`, `e_mail`, `b_date`, `pic`) VALUES ('', '$f_name', '$l_name', '$e_mail',

Re: [PHP] Getting last record ID created from DB

2007-03-17 Thread Mark
Philip Thompson wrote: On Mar 16, 2007, at 10:28 PM, Jeff wrote: Is there a way to get the last Record # created by the DB. Example: User_ID = auto_increment f_name = varchar l_name = varchar e-mail = varchar b_date = varchar pic = varchar Since user_id is an auto_inc field I

[PHP] Getting last record ID created from DB

2007-03-16 Thread Jeff
Is there a way to get the last Record # created by the DB. Example: User_ID = auto_increment f_name = varchar l_name = varchar e-mail = varchar b_date = varchar pic = varchar Since user_id is an auto_inc field I submit it as a NULL, also I haven't started the code for a picture yet either so

Re: [PHP] Getting last record ID created from DB

2007-03-16 Thread Rod Person
On Fri, 16 Mar 2007 22:28:54 -0500 Jeff [EMAIL PROTECTED] wrote: Is there a way to get the last Record # created by the DB. $query = INSERT INTO `t_users` (`user_id`, `f_name`, `l_name`, `e_mail`, `b_date`, `pic`) VALUES ('', '$f_name', '$l_name', '$e_mail', '$b_date', ''); $result =

Re: [PHP] Getting last record ID created from DB

2007-03-16 Thread Janet Valade
Jeff wrote: Is there a way to get the last Record # created by the DB. ... what code could I add here to make the following line work? echo REMEMBER your USER ID# you will need it when creating Characters!! It is: $user_id; - I want to show the user_id just created here. Thanks in

Re: [PHP] Getting last record ID created from DB

2007-03-16 Thread Philip Thompson
On Mar 16, 2007, at 10:28 PM, Jeff wrote: Is there a way to get the last Record # created by the DB. Example: User_ID = auto_increment f_name = varchar l_name = varchar e-mail = varchar b_date = varchar pic = varchar Since user_id is an auto_inc field I submit it as a NULL, also I haven't

Re: [PHP] Getting last record ID created from DB

2007-03-16 Thread Jim Lucas
Janet Valade wrote: Jeff wrote: Is there a way to get the last Record # created by the DB. ... what code could I add here to make the following line work? echo REMEMBER your USER ID# you will need it when creating Characters!! It is: $user_id; - I want to show the user_id just