mysql_insert_id question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql_insert_id question (
/showthread.php?tid=641612)
mysql_insert_id question -
ToiletDuck - 18.09.2017
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.
Re: mysql_insert_id question -
raydx - 18.09.2017
It will return 5.
Re: mysql_insert_id question -
ToiletDuck - 18.09.2017
Quote:
Originally Posted by raydx
It will return 5.
|
Really? It will return to it's AutoIncrement Value not the Row ID?
Re: mysql_insert_id question -
Kane - 18.09.2017
Re: mysql_insert_id question -
ToiletDuck - 18.09.2017
Quote:
Originally Posted by Arthur Kane
|
Wow Thank you. I wonder where did you get the description I keep on searching via ****** and no luck.
And Thanks for the one who answered my question earlier! God bless.