Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread Andrew Ballard
On Mon, Feb 9, 2009 at 11:32 AM, tedd wrote: > At 11:15 AM -0500 2/9/09, Andrew Ballard wrote: >> >> On Mon, Feb 9, 2009 at 11:05 AM, tedd wrote: >> >> > I've learned something new every day of my life -- and I'm getting >> damned >> > tried of it. >> >> Well, you probably know what they say ab

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread tedd
At 11:15 AM -0500 2/9/09, Andrew Ballard wrote: On Mon, Feb 9, 2009 at 11:05 AM, tedd wrote: > I've learned something new every day of my life -- and I'm getting damned > tried of it. Well, you probably know what they say about the day you stop learning Yeah, you got a job with the gov

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread Andrew Ballard
On Mon, Feb 9, 2009 at 11:05 AM, tedd wrote: > At 10:55 AM -0500 2/9/09, Andrew Ballard wrote: >> >> -snip- >> >> Andrew > > As I said many times before. > > I've learned something new every day of my life -- and I'm getting damned > tried of it. > > Thanks for the lesson. > > Cheers, > > tedd We

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread tedd
At 10:55 AM -0500 2/9/09, Andrew Ballard wrote: -snip- Andrew As I said many times before. I've learned something new every day of my life -- and I'm getting damned tried of it. Thanks for the lesson. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthston

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread Andrew Ballard
On Mon, Feb 9, 2009 at 10:27 AM, tedd wrote: > At 9:54 AM -0500 2/9/09, Andrew Ballard wrote: >> >> You are right, but the point is that if you intend something to be >> unique then you should declare it as such in the database. > > We didn't discuss that. > > You are saying that if I checked my d

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread tedd
At 9:54 AM -0500 2/9/09, Andrew Ballard wrote: You are right, but the point is that if you intend something to be unique then you should declare it as such in the database. We didn't discuss that. You are saying that if I checked my database for a email address and find it's not there [1] and

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread Andrew Ballard
On Mon, Feb 9, 2009 at 9:25 AM, tedd wrote: > At 9:00 AM +1100 2/9/09, Chris wrote: >> >> Person a signs up with em...@example.com >> >> Before you are able to fetch the result (which is possible in a high >> traffic site), person b also signs up with em...@example.com >> >> Going back to person a

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-09 Thread tedd
At 9:00 AM +1100 2/9/09, Chris wrote: Person a signs up with em...@example.com Before you are able to fetch the result (which is possible in a high traffic site), person b also signs up with em...@example.com Going back to person a, when you fetch, you get record #2 instead of #1. They are n

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-08 Thread Chris
tedd wrote: At 1:36 AM + 2/8/09, Ashley Sheridan wrote: On Sat, 2009-02-07 at 15:26 -0500, tedd wrote: > That's one way, to use "mysql_insert_id" (probably the best). But another is simply to read back in the record you just created and check the $row['id']. That's the way I do it somet

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-08 Thread tedd
At 1:36 AM + 2/8/09, Ashley Sheridan wrote: On Sat, 2009-02-07 at 15:26 -0500, tedd wrote: > That's one way, to use "mysql_insert_id" (probably the best). But another is simply to read back in the record you just created and check the $row['id']. That's the way I do it sometimes. Cheer

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-07 Thread Ashley Sheridan
On Sat, 2009-02-07 at 15:26 -0500, tedd wrote: > At 12:12 PM -0800 2/7/09, revDAVE wrote: > >On 2/7/2009 11:41 AM, "Stuart" wrote: > > > >>> Then, after I inserted the record - I would do a quick query that would > >>> retrieve the record ID by searching for the random number > >> > >> Ouch th

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-07 Thread tedd
At 12:12 PM -0800 2/7/09, revDAVE wrote: On 2/7/2009 11:41 AM, "Stuart" wrote: Then, after I inserted the record - I would do a quick query that would retrieve the record ID by searching for the random number Ouch that's nasty!! Q: is there a better way to retrieve the record ID from

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-07 Thread Stuart
2009/2/7 revDAVE : > On 2/7/2009 11:41 AM, "Stuart" wrote: > >>> Then, after I inserted the record - I would do a quick query that would >>> retrieve the record ID by searching for the random number >> >> Ouch that's nasty!! >> >>> Q: is there a better way to retrieve the record ID from the newly

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-07 Thread revDAVE
On 2/7/2009 11:41 AM, "Stuart" wrote: >> Then, after I inserted the record - I would do a quick query that would >> retrieve the record ID by searching for the random number > > Ouch that's nasty!! > >> Q: is there a better way to retrieve the record ID from the newly added >> record? > > Use

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-07 Thread Stuart
2009/2/7 revDAVE : > Adding records & capture the new record ID: > > In the past, if I added a new record from a form in a phonebook file as an > example, I would use a web form to fill out the info, and then add and > invisible text item that stored a random number in one of the unused > databas

[PHP] Adding Records & Capture The New Record ID

2009-02-07 Thread revDAVE
Newbie question... Hi folks, Adding records & capture the new record ID: In the past, if I added a new record from a form in a phonebook file as an example, I would use a web form to fill out the info, and then add and invisible text item that stored a random number in one of the unused datab