Jump to content

[SOLVED] php get the auto incement value at the time of insert


jonniejoejonson

Recommended Posts

I want to insert 'message' details into a table that has an autoincrement int. This integer servers as the unique index for the message. However I need to select this index number as it is inserted so that I can store it in another table... do you know how to do this...

 

$sql= "INSERT INTO messages (date,subject,message) VALUES

(NOW(),'$subject','$message')

 

I then want to select the 'messageindex' for this inserted row";

 

(messageindex is the autoincrement integer)

 

thanks to any responders.

 

 

 

 

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.