Scripting/Squirrel/Functions/mysql fetch assoc

From Vice City Multiplayer
Revision as of 18:28, 30 January 2017 by Thijn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

Get a result row as a table

Syntax

mysql_fetch_assoc( MySQLQuery query )

Arguments

  • MySQLQuery query - A valid MySQL result

Return value

The row's column as a table

Example

local c = mysql_query( handler, "SELECT Cash, Kills FROM Accounts WHERE Name='KAKAN'" );
local d = mysql_fetch_assoc( c );
print("Cash: " + d["Cash"] + ", Kills: " + d["Kills"] );
mysql_free_result( c );

Related Functions