Retrive value from mysql table

Im making a bantable that the server checks if a user is in when he/she joins.
The mysql table looks like this.

first off i would like to know how to check the bantime and then can you use table.HasValue to see if the table has the SteamID.
Sorry for this noobish questions its just ive never used HasValue or retrived a value from a 2d table before.

http://www.facepunch.com/showthread.php?t=241247

thank you but i looked at the wiki and couldnt find a way to count how many entries its in a table. How can you do that?

With SQL, the wiki is for lua. Look for SQL tutorials…

I mean with tables not mysql.
How do you count how many entries it is in a table.
In wiremod you use Array:count()
It must me a smilar function in lua

You first have to extract information from your SQL table and place it in a lua one, then you will be able to manipulate it.

And to get the lenght of a lua table use the lenght operator #.

Example :
t = {“q”, 1, 54}
print(#t) – This prints 3

thank you Crazy Quebec
dint know that # was a length operator :golfclap:

only works on tables with sequential numerical keys. It won’t work on tables like this:

{2 = 34, asdf = 9}