Scripting/Squirrel/Functions/mysql fetch assoc: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "Get a result row as a table == Syntax == <pre>mysql_fetch_assoc( MySQLQuery query )</pre> == Arguments == * ''MySQLQuery'' '''query''' - A valid MySQL result == Return valu...")
 
m (Do not sign your edits)
Line 16: Line 16:
mysql_free_result( c );
mysql_free_result( c );
</pre>
</pre>
By KAKAN

Revision as of 03:32, 10 March 2016

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 );