jkkenzie Posted December 3, 2008 Share Posted December 3, 2008 The command below works BUT when i delete ALL data from my database say from my autoincrement primary key field "id" 1to 20, the next inserted field "id" value would be 21, BUT the command below gets 0 instead of 21. I need this code to pick the "id" value used to store the record. $mysqlval= mysql_insert_id(); Thanks Joseph Link to comment https://forums.phpfreaks.com/topic/135308-mysql_insert_id/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 3, 2008 Share Posted December 3, 2008 mysql_insert_id() only works when used immediately after an INSERT query and you would need to tell us how you are deleting all the data from your database. Link to comment https://forums.phpfreaks.com/topic/135308-mysql_insert_id/#findComment-704964 Share on other sites More sharing options...
jkkenzie Posted December 3, 2008 Author Share Posted December 3, 2008 i use phpmyadmin to delete my test data from my database Link to comment https://forums.phpfreaks.com/topic/135308-mysql_insert_id/#findComment-705052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.