Jump to content

Primary key is set to auto increment, after inserting new row... how to get it?


inktri

Recommended Posts

What's the most efficient way to accomplish the following problem:

 

I have a table called: dogs

Attributes: did (primary key, auto increment), name

 

if I run this query within PHP:

INSERT INTO dogs (name) VALUES ("bob")

 

How can I echo the "did" of the newly inserted dog?

 

Thanks for the help!

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.