RE: Re[2]: [PHP-WIN] SQL SELECT while INSERTING
| From: | Asendorf, John | Date: | Thu, 07 Dec 2000 13:48:21 +0000 |
| Subject: | RE: Re[2]: [PHP-WIN] SQL SELECT while INSERTING | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-4347@lists.php.net to get a copy of this message | ||
Thanks for trying on that one though. I haven't had my 3rd pack of cigs yet
today so I know the feeling
---------------------
Founder of
The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium
Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods, Bod
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.
> -----Original Message-----
> From: Ignatius Teo [mailto:iteo@scu.edu.au]
> Sent: Wednesday, December 06, 2000 6:24 PM
> To: 'Gonzalo Vera'; 'Ignatius Teo'
> Cc: 'Asendorf, John'; 'Php-Windows (E-mail)'
> Subject: RE: Re[2]: [PHP-WIN] SQL SELECT while INSERTING
>
>
> 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
> > >>
> >
> >
>