Ghmattimysql: My MySQL Implementation for FiveM [1.3.2]

yyyy-mm-dd h:i:s as a string should be automatically parsed by mysql. So you tried to pass it datetime?

Also if you want to add it for “now”, then you should use NOW() instead of passing a datetime. And instead of using DATETIME you should be using a TIMESTAMP (for shortrange times), so e.g. last login or so.

no no, let me just explain:

Im creating a new RP Framework for my server 2.0 version. When a user creates a account i save the date on the database wit yyyy-mm-dd h:i:s using datetime (MariaDB) but when i call the value from database it popup’s this error that i said above.

Okay. You either provide me now with full details I asked you about or I really will not answer anymore, because it is a waste of my time. I spent now 30 minutes. Installing MariaDB, porting my data, changing the settings to use MariaDB.

And surprise everything worked.

I am not sure if you are aware, but at least MySQL replies with an int, as does MariaDB. And if that was the issue, then you better prepare for a hell of a fight, because making your RP Framework will be tough for you.

There won’t be an update to MySqlConnector 0.37.0; as they implemented SSL/TLS streams which breaks the server for FiveM.Got to wait now until I reach with my commits the current version.

edit: There will be an update soonish. That means this week.

Updated

Changes

  • Major Code refactoring
  • Stability increased a lot (at least for me)
  • Branched out different components
  • Updated to a custom MySqlConnector 0.37.1
1 Like

is there a basic sample of using this in C# for querying a table and enumerating the result? eg “select * from users;”

thanks

There was one; I to have a test project; It was a pain to maintain so I removed it.

The best you can do now is to orient yourself on how the Exports handle it

Normally you would need an await Delay(0); there to wait until the the value has arrived in the server threadpool. But if the ticks are irregular, i found that often to not be enough. So you rather want to use ContinueWith, which should be the proper use anyhow.

So this here is faster and better than mysql? :slight_smile:

mysql is an RDMS.

I assume you mean fivem-mysql-async. Both GHMattiMySQL and fivem-mysql-async will connect to your mysql with the mysqlconnector but this one has much more features and lots of improvements specifically for async queries. The async queries are faster.

1 Like

Okay I see mate.Thanks!

ok, is it possible to please get a copy of that test project in whatever form its in un-maintained or otherwise?

git checkout tags/0.5.3 It has been there all along. Not sure what your idea is of “it was removed” is. It is not permanently gone. Only on newer versions.

… some of us are stupid :wink:

Everything seems to be working well but my chat is now duplicating. When someone types just normal it repeats it.

It seems like your chat resource is started twice, or the chat event is triggered twice. If you bind scripts with @ they get executed everytime, for each time they are loaded via the @.

I guess fixing whatever causes the issue is the way to go. See above. Definately unrelated to MySQL.

Updated

Changes

  • Moved some files around
  • Uses the ConnectionStringBuilder now internally to build a connection string
  • Added a fix for it loading multiple buffers under some circumstances
  • Updated to a custom MySqlConnector 0.38.0 (a different one from mysql-async which results in a small performance gain)
  • Fixed a major copy & paste mistake rendering Transaction inaccessible from Lua
  • Updated the replacement files to include Threaded options and transactions (hopefully without breaking the replacement files).
3 Likes

I am really confused, because on the testserver it worked, but on the mainserver it didnt. I just copied the Mysql Implementation (Changed the db query) but it didnt work.

There should be an accompanying error message. If you actually show that I might actually be able to tell you what went wrong.

There is just an error with esx status but nothing else. Should i enable the debug mode?

Would be nice with a ES/ESX bridge so this would work with esx with out doubt.