samona Posted June 11, 2008 Share Posted June 11, 2008 How do i get the Primary Key when I do an update. When I do an Insert I use mysql_insert_id() to capture the primary key. IS there a way to do it with Update? Link to comment https://forums.phpfreaks.com/topic/109790-how-to-get-mysql_insert_id-for-updates/ Share on other sites More sharing options...
rhodesa Posted June 11, 2008 Share Posted June 11, 2008 No, with UPDATE, you are editing records, not adding ones. So no *new* IDs are generated. You need to know the ID of the record you want to update before doing the update. Link to comment https://forums.phpfreaks.com/topic/109790-how-to-get-mysql_insert_id-for-updates/#findComment-563392 Share on other sites More sharing options...
fenway Posted June 12, 2008 Share Posted June 12, 2008 How do i get the Primary Key when I do an update. When I do an Insert I use mysql_insert_id() to capture the primary key. IS there a way to do it with Update? How did you know which one to update without the PK? Link to comment https://forums.phpfreaks.com/topic/109790-how-to-get-mysql_insert_id-for-updates/#findComment-564088 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.