Scripting/Squirrel/Functions/mysql fetch row

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 an enumerated array.

Syntax

mysql_fetch_row( query );

Arguments

  • query - Name of the previously executed query.

Example

function onPlayerCommand(player, cmd, parameters)
{
if (cmd == "stats")
{
local query = mysql_query(vcmpdb, "SELECT kills, deaths FROM accounts WHERE name = '"+player.Name+"'");
local stats = mysql_fetch_row(query);
ClientMessage( "Your stats - Kills: "+stats[0]+", Deaths: "+stats[1]+".",player,255,255,255);
}

Related Functions