please repair im need fetchScalar with api promise …
10 YEAR LATER … no update
please repair im need fetchScalar with api promise …
10 YEAR LATER … no update
Then don’t use this library or fix it yourself, i’m not at your service.
2.0.2 released should resolve the null bug and avoid fatal error (see 2.0.1)
nice sorry im not patient
thx for fix you have a best plugin 
to execute thread: ui_srv.lua:63: attempt to call a nil value (field 'fetchScalar')
stack traceback:
ui_srv.lua:63: in upvalue 'handler'
citizen:/scripting/lua/scheduler.lua:163: in function <citizen:/scripting/lua/scheduler.lua:162>
stack traceback:
[C]: in function 'error'
citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
citizen:/scripting/lua/scheduler.lua:162: in function <citizen:/scripting/lua/scheduler.lua:131>
not work after update
i’m change with Sync for fix temporarily
This is in the experimental branch on github only, will do a 2.1.0 when i will have time to better test this myself
Haaj everybody
Can pls somebody help me explain set this up.
I have es_rp and banking running just like essential mode.
And now I need this for cops but I don’t get it work
Thanks allready
hello guys im getting this error on my server.
Failed to load script @async/async.lua.
is this normal or is there a fix
Hi,
Can someone explain what’s the difference between fetchAll and fetchScalar please ?
Thanks
Edit: Got it.
fetchAll simply returns the whole result of the query
fetchScalar returns the first field of the first row
I don’t suppose somebody can help with the following error code.
Exception rethrown at [0]:
at (wrapper xdomain-invoke) CitizenFX.Core.InternalManager:CallRef (int,byte[],intptr&,int&)
at (wrapper remoting-invoke-with-check) CitizenFX.Core.InternalManager:CallRef (int,byte[],intptr&,int&)
at CitizenFX.Core.MonoScriptRuntime.CallRef (System.Int32 refIndex, System.Byte[] argsSerialized, System.Int32 argsSize, System.IntPtr& retvalSerialized, System.Int32& retvalSize) [0x00013] in /src/code/client/clrcore/MonoScriptRuntime.cs:151
Error running system event handling function for resource mysql-async: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: citizen:/scripting/lua/scheduler.lua:453: An error happened while calling export mysql_configure of resource mysql-async (citizen:/scripting/lua/MessagePack.lua:830: missing bytes), see above for details
stack traceback:
[C]: in function 'error’
citizen:/scripting/lua/scheduler.lua:453: in method 'mysql_configure’
lib/init.lua:3: in upvalue 'handler’
citizen:/scripting/lua/scheduler.lua:163: in function citizen:/scripting/lua/scheduler.lua:162
stack traceback:
[C]: in function 'error’
citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow’
citizen:/scripting/lua/scheduler.lua:162: in function citizen:/scripting/lua/scheduler.lua:131
hitch warning: frame time of 257 milliseconds
Can someone help with this error?
[ 170172] [ERROR] [MySQL] An critical error happens on MySQL for query "SELECT * FROM users WHERE `identifier`=@identifier; {identifier=steam:110000111c28d35}": Method 'System.Security.Cryptography.X509Certificates.X509Certificate2..ctor' not found. at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170187] at MySql.Data.Serialization.MySqlSession.InitSslAsync (MySql.Data.Serialization.ProtocolCapabilities serverCapabilities, MySql.Data.Serialization.ConnectionSettings cs, MySql.Data.Protocol.Serialization.IOBehavior ioBehavior, System.Threading.CancellationToken cancellationToken) [0x00044] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
[ 170187] at MySql.Data.Serialization.MySqlSession+<ConnectAsync>d__49.MoveNext () [0x003da] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
[ 170203] --- End of stack trace from previous location where exception was thrown ---
[ 170203] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170203] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170219] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170219] at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170219] at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170234] at MySql.Data.MySqlClient.ConnectionPool+<GetSessionAsync>d__0.MoveNext () [0x00467] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
[ 170250] --- End of stack trace from previous location where exception was thrown ---
[ 170250] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170250] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170266] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170266] at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170266] at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170281] at MySql.Data.MySqlClient.MySqlConnection+<CreateSessionAsync>d__68.MoveNext () [0x00102] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
[ 170281] --- End of stack trace from previous location where exception was thrown ---
[ 170297] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170297] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170297] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170312] at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170312] at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170312] at MySql.Data.MySqlClient.MySqlConnection+<OpenAsync>d__19.MoveNext () [0x000cb] in <5d2e43c2aa6f4da0bb43a6a12077ad51>:0
[ 170328] --- End of stack trace from previous location where exception was thrown ---
[ 170328] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170328] at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170344] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170344] at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170344] at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0
[ 170359] at MySQLAsync.Operation`1+<ExecuteAsync>d__3[TResult].MoveNext () [0x000aa] in <6b79789832b34a31961dbb39358e1b3f>:0
Thankyou for this library, using it in my framework, great job.
Un grand merci frenchy 
Brouznouf, is possible and there is a guide on how to use MySQL Async coding in C# insted of lua?
Thx very much.
does it can be use for xampp ?
Yes, I wouldn’t think it would cause any issues. However, you’ll need to edit the values to whatever your actual server values are.
I don’t know if you’ve already figured out how to use MySQL Async in C# instead of lua, but I’ve gotten close.
Basically you can call the Exported functions in about the same way:
Exports["mysql-async"].mysql_execute("sql statement", parameters, callback);
Except the parameters are a IDictionary<string, object>, done something like this:
var parameters = new Dictionary<string, object>();
parameters.Add("@parameter", variable);
The only part that I haven’t quite figured out is the callback because I don’t quite understand how to use the CallbackDelegate class yet.
Also, don’t forget to load the mysql-async resource in your server.cfg:
start mysql-async
And if anyone could help shed some light on how I use the CallbackDelegate class in C# I think I could get MySQL Async working in my C# scripts.
Thanks in advance for any help.
So I did actually get this working by doing this in the ‘callback’:
new Action<int>(OnDatabaseCallback)
And OnDatabaseCallback just looks like this (since I don’t actually want to do anything on the callback, except maybe saying that the save happened successfully):
private void OnDatabaseCallback(int result)
{
}
So I’m a total newb. I mean, a COMPLETE newb.
Is anyone willing to sit with me in Discord or something and explain MySQL and Async to me so that I understand what it does and how resources that require it, use it and what they do with it?
Pretty please. Muchos Gracias. Love ya long time.