SuperiorServers / gm_tmysql4

MySQL connection module for Garry's Mod servers - SUP has picked up and maintained the module since it was abandoned years ago - Original author: @bkacjios
31 stars 7 forks source link

Having a problem with the module and Multiple Statements in a single string. #10

Closed VaasKahnGrim closed 4 years ago

VaasKahnGrim commented 4 years ago

so currently I have a function which is performing a query like so: DB:Query("SELECT * FROM characters WHERE SteamID = '"..steam64.."'; SELECT * FROM charwhitelist WHERE SteamID = '"..steam64.."'",function(results) --Do Stuff with the data retrieved end)

However when running it like this I end up getting a syntax error. But removing the second statement stops the error from happening. Only problem is that I'm unable to perform the two queries and then run the callback function after both have been completed. as far as I can tell I'm following the doccumentation in the readme.md file but I'm ending up with this issue happening.

For context I'm converting an addon from mysqloo to tmysql4 instead.

VaasKahnGrim commented 4 years ago

nvm, apparently the issue was related to the DB object :/ welp thats one issue resolved. all I have to do now is figure out whats wrong with the query results and I should be good to go.

KingofBeast commented 4 years ago

What error specifically were you getting?

Also, were you connecting with CLIENT_MULTI_STATEMENTS ?

VaasKahnGrim commented 4 years ago

basically I had CLIENT_MULTI_STATEMENTS in the DB object, but I looked over the doccumentation 30 times or so and never noticed the nil value just before it in the example. so CLIENT_MULTI_STATEMENTS was basically my socketfile path lol.