SA-MP Forums Archive
mysql insert id? - 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? (/showthread.php?tid=443553)



mysql insert id? - .Mento - 12.06.2013

When someone registers in my server, they get an account id. Now I use the new plugin, but I use this

Код:
mysql_store_result();
	new accountN = mysql_insert_id();
	mysql_free_result();
What would be the code for this using cache?

Thanks!


Re: mysql insert id? - .Mento - 12.06.2013

Anyone?


Re: mysql insert id? - Vince - 12.06.2013

I believe there is wrapper so you shouldn't have to do anything. I should note, though, that there is no result after performing an insert query so there is no need to store nor free it.


Re: mysql insert id? - MP2 - 12.06.2013

Use mysql_insert_id() in the callback from the threaded query.

P.S. Don't use cache for INSERT queries - there's nothing to store..