Jump to content

[SOLVED] Retrieving an Inserted Value on an Insert Command


Mzor

Recommended Posts

I'm sorry if there is already a thread asking this question, I searched but wasn't really sure of what keywords to use. Anyway, this is my question.

 

What I need to do is somehow retrieve an automatically incremented primary key from a row that I just inserted. So something like, if a user just posted a comment, the PHP script could tell them that, "Your comment's ID is $comment_id" (Made up situation).

 

Thanks for the help. I know there are ways to get that variale, ut those other ways just require more scripting and more queries.

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.