View Single Post
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-28-2020 , 11:27   Re: SQL: Very confused!
Reply With Quote #10

Quote:
Originally Posted by generalmemer View Post
Just bumped here and since he didn't mind to let us all know his solution 12 years ago, it's that you have to call SQL_GetInsertId() in the query callback using the main database connection handle and take it from there. Because the query doesn't execute instantly, we have to wait for the callback. Otherwise it'll return 0. Nothing is wrong with the function.
This 12 year old thread far predates threaded SQL support - there was no callback involved in the original code.
__________________
asherkin is offline