• Getting info from a database (mysqloo module)
    9 replies, posted
Im trying to extract a string (this case is a SteamID64) from a database with the mysqloo module, but im trying all the ways but i cant find the correct way, this is how my database composses: Database Name: najdhton_apply Table Name: Applications Value 1:avatar (Their Steam Avatar keeps saved on the database to print it on the website) Value 2:name (Their Steam Name keeps saved on the database to print it on the website) Value 3:status (Their Status keeps saved on the database to print it on the website and be able to see who got accepted.) Value 4:steamid(Their SteamID64 keeps saved on the database to be able to give the player their rank automatly) Value 5:userm (Their Personal Email keeps saved on the database to be able to contact them through E-Mail) This is part from my script when it connects to the database successfully, i want to get the steamids64 only if they has "Accepted." value on it [CODE] function db:onConnected() print( "\n ==================================================================== \n Apply System has been connected to the database '"..ApplySystem_DBName.."' successfully. \n ==================================================================== \n " ) local q = self:query( "SELECT status, steamid FROM "..ApplySystem_TableName.." WHERE status = 'Accepted.'") function q:onSuccess( string ) local PlayerTableSteamID64 = sql.QueryValue("SELECT steamid FROM "..ApplySystem_TableName.." WHERE status = 'Accepted.'") --HERE IS WHERE I NEED TO GET THE STRING FROM THE DATABASE end[/CODE] Where or how can i get the function to be able to get strings from a database?
the query is wrong. by the way use CODE tags.
What do you mean with is wrong? PD: Why did you just removed me from Steam? lol
You didn't do q:start()
[QUOTE=wholegamer;49758861]You didn't do q:start()[/QUOTE] he uses gmod sql and remote sql in one.
So how can i fix it then?
Haven't used mysqloo in awhile because of how outdated it is, though the one issue I can see is you're mixing mysqloo and the default litesql functions in gmod. sql.QueryValue is used to get the value from the litesql
You should change [I]sql.QueryValue[/I] to [B]db:query(query here)[/B]
[QUOTE=wholegamer;49763113]You should change [I]sql.QueryValue[/I] to [B]db:query(query here)[/B][/QUOTE] well thanks for rating disagree on my actually right post, and then even posting what I said, lol. But yeah @OP you should replace it with actual MySQL function & I recommend that you use [URL="https://facepunch.com/showthread.php?t=1442438"]tmysql4[/URL], since it also has a [URL="https://raw.githubusercontent.com/blackawps/gm_tmysql4/master/mysqloo.lua"]lua file that makes every addon which requires MySQLOO, use tmysql4 anyways[/URL].
fixed it for him, topic can be closed ^^
Sorry, you need to Log In to post a reply to this thread.