Scripting/Squirrel/Functions/GetSQLColumnCount: 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 the column count in a query. == Syntax == <pre>GetSQLColumnCount( query )</pre> == Arguments == * '''query''' - Name of the previously executed query. == Return valu...")
 
No edit summary
 
Line 20: Line 20:
FreeSQLQuery( query );
FreeSQLQuery( query );
}</source>
}</source>
== Related Functions ==
{{Scripting/Squirrel/Functions/SQLite Functions}}
[[Category:Scripting/Squirrel/Functions/SQLite _Functions]]

Latest revision as of 19:01, 30 January 2017

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