Jump to content

[SOLVED] getting auto_incremented id


bennyboywonder

Recommended Posts

currently I use the SQL statement

 

$query = "INSERT INTO items (user, refId, itemType, itemName) VALUES ('$sessUser', $maincat, 4, '$name')";

 

to add certain items to my database. In this table, their is an auto_incrementing primary key. Is their a way of having this same sql statement also return the primary key for the row that the data is placed into?

Link to comment
https://forums.phpfreaks.com/topic/41605-solved-getting-auto_incremented-id/
Share on other sites

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.