INSERT and SELECT

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

INSERT and SELECT

Post by Todd_Z »

I have an autoincrement and unique id num in a db, and when I insert a field, i want to have the query return the id for that row. Can i do that in a single sql?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

no, but the mysql functions can tell you what ID it set... mysql_insert_id
Post Reply