Re: Inseting info into MySQL and retrieving all in one SQL command
| From: | Scott Mebberson | Date: | Thu, 09 Aug 2001 01:05:09 +0000 |
| Subject: | Re: Inseting info into MySQL and retrieving all in one SQL command | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-11146@lists.php.net to get a copy of this message | ||
Thanks, Beau. Great advice!
"Scott Mebberson" <scott@redbluedesign.com> wrote in message
news:20010809005013.40394.qmail@pb1.pair.com...
> Hi guys,
>
> I am adding some information to my MySQL database. It is user's
information.
> So it has things like email address, password, username, all that sort of
> stuff.
>
> What I need to do is once I have added it found out the id - a primary key
> which auto increments itself. At the moment I am doing two different MySQL
> queries an INSERT and a SELECT to first of all add the information and
then
> find out the primary key.
>
> Is there anyway I can do this in one step?
>
> Thanks in advance
>
> Scott Mebberson
> scott@redbluedesign.com
>
>