Question about mysql_insert_id
#3

Quote:
Originally Posted by ComDuck
View Post
mysql_insert_id is deprecated. If your query is an INSERT, then you
use cache_insert_id.



You don't have to worry about it. The MySQL documentation states that the native will return the last AUTO_INCREMENT value based on a per-connection basis:



It is impossible for two different connections to collide with each other, as all clients will be sitting in their own unique connection to the server.
Thank you!

What is the difference between
Code:
cache_insertid
and
Code:
mysq_insert_id
i have this code in my server
Code:
forward OnQueryInsertBaseObject(baseidx, objectid);
public OnQueryInsertBaseObject(baseidx, objectid)
	return BaseObjectData[baseidx][objectid][oSQLId] = mysql_insert_id(MainPipeline);
basically when the user execute a query to insert in the table this function is called and save the id into the variable
which is safer to use?
Reply


Messages In This Thread
Question about mysql_insert_id - by ToiletDuck - 09.02.2019, 17:05
Re: Question about mysql_insert_id - by ComDuck - 09.02.2019, 17:35
Re: Question about mysql_insert_id - by ToiletDuck - 09.02.2019, 17:53
Re: Question about mysql_insert_id - by ComDuck - 09.02.2019, 18:21
Re: Question about mysql_insert_id - by ToiletDuck - 09.02.2019, 18:40

Forum Jump:


Users browsing this thread: 4 Guest(s)