18.09.2017, 09:03
I have a question of mysql_insert_id.
does Mysql_insert_id returns to the auto increment value?
Let says I'm using the Unique ID of each row in my Mysql Table. I'm using the Auto Increment
so for example there are 4 rows in my table then there should be
----
1 = ID
2 = ID
3 = ID
4 = ID
----
and then I deleted the ID 2 so the out come will be
----
1 = ID
3 = ID
4 = ID
----
after that I insert a row so the outcome will be
----
1 = ID > row id = 1
3 = ID > row id = 2
4 = ID > row id = 3
5 = ID > row id = 4 // New Inserted
----
and I will use mysql_inser_id. Does the mysql_insert_id will return to the autoincrement value? the 5 ID or it will return in row id ?
I'm quite confused. I hope someone will understand what I'm trying to say lol.
Thanks In Advance.
does Mysql_insert_id returns to the auto increment value?
Let says I'm using the Unique ID of each row in my Mysql Table. I'm using the Auto Increment
so for example there are 4 rows in my table then there should be
----
1 = ID
2 = ID
3 = ID
4 = ID
----
and then I deleted the ID 2 so the out come will be
----
1 = ID
3 = ID
4 = ID
----
after that I insert a row so the outcome will be
----
1 = ID > row id = 1
3 = ID > row id = 2
4 = ID > row id = 3
5 = ID > row id = 4 // New Inserted
----
and I will use mysql_inser_id. Does the mysql_insert_id will return to the autoincrement value? the 5 ID or it will return in row id ?
I'm quite confused. I hope someone will understand what I'm trying to say lol.
Thanks In Advance.