Ulysses
General => Developers Corner => Topic started by: iViscosity on February 25, 2018, 09:15:48 AM
-
I've been using Drakehawke's MySQLoo module (Facepunch article (https://gmod.facepunch.com/f/gmodaddon/jjdq/gmsv-mysqloo-v9-Rewritten-MySQL-Module-prepared-statements-transactions/1/)) to handle saving for an addon I'm creating, and I was wondering if anyone was good with it. I understand the basics of how it works, and I have a basic knowledge of the SQL language, but I'm having trouble understanding one thing. According to the docs (https://github.com/FredyH/MySQLOO/blob/master/README.md), there is a "Query.onSuccess( q, data )" function, (which I'm writing as "q:onSuccess( data )") but my question is how is that data returned?
I know it's returned in a table, but is it a sequential key-value table or is it sorted based on my query? Basically, my query is "SELECT * FROM aset" (aset is the table I've created) which has the following structure:
aset (
username VARCHAR(50) NOT NULL,
steamid VARCHAR(255) NOT NULL,
exp INT NOT NULL,
level INT NOT NULL,
PRIMARY KEY (steamid)
)
(Yes, I know allocating 255 to the VARCHAR isn't the best practice, but if anyone could explain how much I'd need that for me that'd be great)
so if I ran the query "SELECT * FROM aset", how would then that data be sorted?
As a side note, if I included a "WHERE steamid = %s" (using string.format() on the query), would that table then be sorted in the same way or the keys being the steamid?
I tried to make this as clear as possible, let me know if you need any clarification.
EDIT: For more information, the SteamID I'm using is a SteamID64, not 32.