Jump to content


Recommended Posts


Hi @Wrexor :smile:

I can work whit this sytax?


LuaSQL("UPDATE NathDB.dbo.account SET i_m_p_s = i_m_p_s + "..crystal.." WHERE act_name = '"..accountName.."'")
Edited by Ximboliex

Share this post

Link to post
Share on other sites
On 1/19/2017 at 2:30 AM, Angelix said:

@Wrexor that helped a lot! I didn't quite understand KONG's explanation and I though the functions only returned one value, that's where I was wrong since I didn't quite get the return of two values. Now with that and your help, I was able to get my account name. :P


function GetAccountName()
	local String = "SELECT act_name FROM GameDB.dbo.account WHERE act_id IN (SELECT act_id FROM GameDB.dbo.character WHERE cha_name = 'Angelix')"
	local Connect, ConnectID = LuaSQL("connect", SQL.GameDB.Host, SQL.GameDB.User, SQL.GameDB.Password)
	if Connect == SQL_SUCCESS_WITH_INFO then
		print("Successful connection.")
		local Success, Query = LuaSQL("query", ConnectID, String)
		if Success == SQL_SUCCESS_WITH_INFO then
			print("Successful query.")
			local Data = LuaSQL("fetch", ConnectID, Query)
			print("Account Name = "..Data["act_name"])
			LuaSQL("freehandle", ConnectID, Query)
			LuaSQL("close", ConnectID)

Which for testing purposes resulted this on GS console. :P



Thanks a lot on both of you for the explanations and Vector since I got the query command from him on another thread since I have zero knowledge of SQL, hahah.

@Ximboliex check this


  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now