๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: chile.comp.programacion
Article #2923

Re: Obtener ID despues de una insercion (PHP+MySQL)

#2923
From: Chano
Date: Thu, 21 Jul 2005 16:00
18 lines
1909 bytes
Cristian Gutierrez <crgutier@dcc.uchile.cl> escribio:
> Hoy en la tarde, jgarrido@dcc.uchile.NOSPAM.cl dijo:
>>   Necesito insertar datos en una tabla, que tiene un campo ID integer
>> con autoincremento.  Al insertar los datos, me gustar๏ฟฝa poder
>> recuperar el ID del campo insertado, de manera de poder usarlo en
>> otras tablas. Hay forma de recuperarlo sin tener que realizar otra
>> consulta?

> mysql_insert_id() ?

  Gracias a ambos.

  No es que no busque, pero siempre que pregunto aca es pq no ha sido un
buen dia para mi cerebro :)

-- 
Chano
jgarrido[@]dcc.uchile.cl
Technical Details
Message-ID: <dbogr4$ngl$2@localhost.localdomain>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!newspeer1.nwr.nac.net!in.100proofnews.com!in.100proofnews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!nntp-server.pubsub.com!news1.nivel5.cl!news.cec.uchile.cl!not-for-mail
References: <dbm61n$rdd$5@localhost.localdomain> <87wtnl3wd1.fsf@guti.no-ip.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,6e6fc2fd18ca8644
X-Google-Attributes: gid1593cb,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsread.com!newsprint.newsread.com!newspeer1.nwr.nac.net!in.100proofnews.com!in.100proofnews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!meganewsservers.com!feeder2.on.meganewsservers.com!nntp-server.pubsub.com!news1.nivel5.cl!news.cec.uchile.cl!not-for-mail
From: Chano <jgarrido@dcc.uchile.NOSPAM.cl>
Newsgroups: chile.comp.programacion
Subject: Re: Obtener ID despues de una insercion (PHP+MySQL)
Date: Thu, 21 Jul 2005 16:00:36 +0000 (UTC)
Organization: Chano Records Inc.
Lines: 18
Sender: Jose Miguel Garrido Urzua <jgarrido@cipres.cec.uchile.cl>
Distribution: world
Message-ID: <dbogr4$ngl$2@localhost.localdomain>
References: <dbm61n$rdd$5@localhost.localdomain> <87wtnl3wd1.fsf@guti.no-ip.org>
NNTP-Posting-Host: cipres.cec.uchile.cl
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: localhost.localdomain 1121961636 24085 200.9.100.5 (21 Jul 2005 16:00:36 GMT)
X-Complaints-To: news@localhost.localdomain
NNTP-Posting-Date: Thu, 21 Jul 2005 16:00:36 +0000 (UTC)
X-Nick: Chano
User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (SunOS/5.8 (sun4u))