Closed TomWong-HK closed 7 years ago
Hey you must remove the quote around @username like said in the upgrading guide
Thank your quick reply, I can get it works now!
I also noticed that the server does not print the full query string with parameters. It may be better by adding something like:
function MySQL.Async.wrapQuery(next, Connection, Message, params)
if type(params) == "table" then
for param in pairs(params) do
Message = string.gsub(Message, param, "'"..params[param].."'")
end
end
So the wrapQuery accepts params table and print the full query string to the server console.
Yes, maybe, would prefer a way to retrieve directly the executed query from the underlying lib, instead of doing all this.
When the command executes, it does not replace the @username to variable 'str' Server console prints SELECT * FROM user WHERE username = '@username'
If the Command.Parameters.AddWithValue(Param, Parameters[Param]) function in Utils.lua is replaced by Command.CommandText = string.gsub(Command.CommandText, Param, Parameters[Param]), then it seems to work fine without having the problem.