RE: Re[2]: [PHP-WIN] SQL SELECT while INSERTING
| From: | Ignatius Teo | Date: | Wed, 06 Dec 2000 23:24:28 +0000 |
| Subject: | RE: Re[2]: [PHP-WIN] SQL SELECT while INSERTING | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4338@lists.php.net to get a copy of this message | ||
Oops, missed the bit about Access ODBC...sorry..I haven't had my 4th cup of coffee and 3rd
ciggy yet...still waking up :-0
Ignatius
> -----Original Message-----
> From: Gonzalo Vera [mailto:gvz@eucalipto.net]
> Sent: Thursday, 7 December 2000 10:16
> To: Ignatius Teo
> Cc: 'Asendorf, John'; 'Php-Windows (E-mail)'
> Subject: Re[2]: [PHP-WIN] SQL SELECT while INSERTING
>
>
> > Nope. You have to insert the record first (otherwise how the heck
> > will MySQL know what the next key is?). After the record is
> > inserted, you can access the key with: mysql_insert_id ([int
> > link_identifier])
>
> Hmmm... ok for MySQL, but I think access is a little different. At
> least when you manually add a record, the key is assigned immediately.
> I'll do some experimenting and call back if I get something.
>
> Gonzalo.
>
> >> -----Original Message-----
> >> From: Asendorf, John [mailto:JAsendorf@lcounty.com]
> >> Sent: Thursday, 7 December 2000 06:42
> >> To: Php-Windows (E-mail)
> >> Subject: [PHP-WIN] SQL SELECT while INSERTING
> >>
> >>
> >> Hello all,
> >>
> >> Have a quick question. Can I select an auto-incrementing key
> >> at the same
> >> time I am 'inserting into' a new record...
> >>
> >> using Access ODBC
> >>
> >> like this
> >>
> >> $sql = "INSERT INTO blocked (page,name,email,attempt) VALUES
> >> ('$page','$name','$email','$attempt')
> >>
> >> AND GET THE KEY FROM THIS ENTRY HERE
> >>
> >> ;";
> >>
> >> Thanks all,
> >>
> >> John
> >>
> >> ---------------------
> >> John Asendorf - jasendorf@lcounty.com
> >> Web Applications Developer
> >> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> >> Licking County, Ohio, USA
> >> 740-349-3631
> >>
> >> Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur.
> >>
> >>
> >>
> >>
> >>
> >> --
> >> PHP Windows Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> >> For additional commands, e-mail: php-windows-help@lists.php.net
> >> To contact the list administrators, e-mail:
> >> php-list-admin@lists.php.net
> >>
>
>