Mailinglisten-Archive |
Hi,
LAST_INSERT_ID()
In der (Online-)Doku (www.mysql.com) im Kapitel
22.4.54 How can I get the unique ID for the last inserted row?
INSERT INTO foo (auto,text)
VALUES(NULL,'text'); # generate ID by inserting NULL
INSERT INTO foo2 (id,text)
VALUES(LAST_INSERT_ID(),'text'); # use ID in second table
HTH
MfG
Martin Knauer
php::bar PHP Wiki - Listenarchive