Scripting/Squirrel/Functions/GetSQLColumnCount

From Vice City Multiplayer
Revision as of 19:01, 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 the column count in a query.

Syntax

GetSQLColumnCount( query )

Arguments

  • query - Name of the previously executed query.

Return value

  • The column count of 'query'.

Example

local db = ConnectSQL( "db.db" );
local query = QuerySQL( db, "SELECT * FROM Accounts" );
if ( query ) {
	print( "There are " + GetSQLColumnCount( query ) + " accounts in database." );
	FreeSQLQuery( query );
}

Related Functions