Ghmattimysql: My MySQL Implementation for FiveM [1.3.2]

Hello, does anybody know what could be causing this? I’ve spent days on this now and the progress has slowed down now with this being (hopefully) my last obstacle in the way. Thanks! #Noob

do you have a dependency set?

http://docs.fivem.net/scripting-reference/resource-manifest/resource-manifest/

Or are you referring to the C# version? Though execute would be in the js one.

Here’s the resource manifest for the police script.

When I try to join my server it says “Cannot load resource : ghmattimysql”!!! PLEASE HELP

I put this in my server for the police script but the police script still isnt loading, how do i fix and did i put this in wrong?

@madasafish2010 Did you get it to work?

I’m having the same issue, trying to call:

Exports["ghmattimysql"].execute("my SQL request", myCallbackFunction);

results into:

Exception during executing Post callback: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: `CitizenFX.Core.ExportSet' does not contain a definition for `execute'

EDIT: SOLVED
The problem was I was trying to call execute from the client script whereas it is intended to be used from server scripts.

Any idea with the latest version of GHMattiSQL I have to restart my vehicle shop after bringing server up in order for it to work. Players get stuck in menu without restarting it. After restarting the script live it works flawlessly

Hi, I have a problem I can not join my server I have this error:Couldn't load resource ghmattimysql

I tried several times to reinstall it without success !!

Can u help me pleaseee

^^^^^Same as above I couldn’t get this dam thing loaded, I have tried so many different methods but nothing seems to want it to work! Can some one please help me or explain it to me please, may be explain it in dummy terms lol Thanks, AND yes I have added to start.cfg and put it in resources lol, it just don’t wana work. No matter where I put it.

wow 21 days later no answers lol

That’s because
a) the author is very busy
b) you guys are giving close to 0 information. There must be an error thrown.

1 Like

Actually this my stupid mistake I dint go to GitHub and download, the latest release of this, such a rookie mistake! I will leave a link here https://github.com/GHMatti/ghmattimysql/releases/download/1.1.0/ghmattimysql.zip so others can download the latest release. I would like to say thanks for trying to help my stupidity.

1 Like

image
image
image
image

no error in the console

???

yo could you help me i have the latest crap and it still wont load.

you ever find the fix?

Any update to Linux using the latest versions of this?

I did a sneak edit somewhen without posting changes here, I think it works on linux.

1 Like

Hey can someone help me because i keep getting this error and i have no clue how to fix it!

Started resource sessionmanager

Argument count mismatch (passed 1, wanted 2)

Started resource ghmattimysql

Error loading script server/server.lua in resource police: citizen:/scripting/lua/scheduler.lua:699: No such export execute in resource ghmattimysql

stack traceback:

[C]: in function ‘error’

citizen:/scripting/lua/scheduler.lua:699: in metamethod ‘__index’

server/server.lua:18: in main chunk

Failed to load script server/server.lua.

Started resource police

this may not be ghmatti related but i couldnt reproduce it any other way, but people having weird usernames such as 𝖜𝖎𝖝𝖆 triggers the following error:

Error: (node:4900) UnhandledPromiseRejectionWarning: Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xF0\x9D\x96\x9C\xF0\x9D...' for column 'name' at row 1
    at Query.Sequence._packetToError (ghmattimysql.js:109:1148)
    at Query.ErrorPacket (ghmattimysql.js:207:1569)
    at Protocol._parsePacket (ghmattimysql.js:308:5471)
    at Parser.write (ghmattimysql.js:314:1645)
    at Protocol.write (ghmattimysql.js:308:875)
    at Socket.<anonymous> (ghmattimysql.js:140:2050)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    --------------------
    at Pool.query (ghmattimysql.js:260:3788)
    at Promise (ghmattimysql.js:278:1421)
    at new Promise (<anonymous>)
    at execute (ghmattimysql.js:278:1386)
    at Object.global.exports [as callback] (ghmattimysql.js:278:2014)
    at citizen:/scripting/v8/main.js:87:41
    at citizen:/scripting/v8/main.js:51:18
    at setImmediate (ghmattimysql.js:278:1292)
    at Object.callback (citizen:/scripting/v8/timer.js:96:21)
    at onTick (citizen:/scripting/v8/timer.js:121:27)
Error: (node:4900) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Error: (node:4900) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

however, manually importing that into the database works, any ideas?

4-byte UTF-8 characters are somehow special in MySQL, to use them:

  1. make sure your tables and columns are utf8mb4
  2. pass charset parameter to node-mysql, using ?charset=utf8mb4 in connection string, or "charset": "utf8mb4" in config.json.

see also: this SO answer

1 Like