When you poll the query, it returns a table including other tables, each one represents a row, like this:
local dbQ = dbQuery(database, "SELECT * FROM `players` WHERE `serial` = ?", player_serial)
local dbR = dbPoll(dbQ, -1)
-- in this case you're only expecting one row so the player will be dbR[1]
serial = dbR[1].serial
name = dbR[1].name
-- If you're dealing with multiple entries:
local dbQ = dbQuery(database, "SELECT * FROM `players`")
-- This will result:
{
{name = "player1", serial="serial1", ...},
{name = "player2", serial="serial2", ...},
-- and so on
}
About the dbExec, it will almost have no effect on the performance in your case, the query when the resource start will take some milliseconds ( kind of unnoticeable server lag ), so it should be fine. also you can test the performance by the getTickCount function to make sure everything is good