[HELP] MySQL Async Library don't want to change the parameter

Hi,

I install MySQL Async Library on my server, but when i want to do a request the parameter don"t want to replace, like this :

My code :

MySQL.Async.fetchAll("SELECT * FROM user_vehicle WHERE identifier = @identifier",{['@identifier'] = getPlayerID(source)}, function(data)

And this is for all resources. Thanks for help :smiley:

Same for this :

MySQL.Sync.execute("UPDATE users SET isOnline=1 WHERE id=@id", {['@id'] = user_id})
MySQL.Sync.execute("UPDATE users SET isOnline=1 WHERE id=@id", {['@id'] = 10})

Have you tried changing the parameter name. I think there’s something in SQL where you can’t have a parameter and column with the same name. So, try something like

MySQL.Async.fetchAll("SELECT * FROM user_vehicle WHERE identifier = @playerID",{['@playerID'] = getPlayerID(source)}

Thank for reply but nothing change

The output in the server console doesn’t show that it replaced it, but the query runs as if it did. This isn’t an issue. If you aren’t getting return values, then there is something else wrong with your query. Also, this probably should have been made as a comment to the original topic because it concerns a specific resource, not FiveM, but idk. ĀÆ_(惄)_/ĀÆ

Also, to Havoc, the column and ā€œparameterā€ as you called it can be the same because it is handled by the script and the parameter is changed before it ever gets sent to the database.

OK, I’m going to close this as it does seem to be an issue with the addon you’re using and not your query like I originally suspected. To get further help I suggest commenting in the original topic or, create an issue on the github repo for it.

Also, @KennethDev if you want to comment on something I say, can I suggest you either @ me or, quote me so I get the notification :stuck_out_tongue:.

1 Like