tibberous Posted January 17, 2009 Share Posted January 17, 2009 I have a table that sets the order number to the row id + 'P'. If I insert a record, can I refer to the auto-incrementing row id during the insert somehow? get_last_id doesn't seem to work. Quote Link to comment https://forums.phpfreaks.com/topic/141264-way-to-refer-to-auto-incrementing-id-in-an-insert/ Share on other sites More sharing options...
DeanWhitehouse Posted January 18, 2009 Share Posted January 18, 2009 Use a query to get the id Quote Link to comment https://forums.phpfreaks.com/topic/141264-way-to-refer-to-auto-incrementing-id-in-an-insert/#findComment-739394 Share on other sites More sharing options...
dawsba Posted January 18, 2009 Share Posted January 18, 2009 $last_id = mysql_insert_id(); Quote Link to comment https://forums.phpfreaks.com/topic/141264-way-to-refer-to-auto-incrementing-id-in-an-insert/#findComment-739415 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.