Scripting/Squirrel/Functions/GetSQLColumnData: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "Get a result row as a string. == Syntax == <pre>GetSQLColumnData( query, columnNumber )</pre> == Arguments == * '''query''' - Name of the previously executed query. * ''...") |
No edit summary |
||
Line 15: | Line 15: | ||
== Example == | == Example == | ||
< | <source lang=squirrel>local db = ConnectSQL( "db.db" ); | ||
local | local query = QuerySQL( db, "SELECT Cash FROM Accounts WHERE Name='KAKAN'" ); | ||
if( | if ( query ) { | ||
</ | local data = GetSQLColumnData( query, 0 ); | ||
if( data ) print( "KAKAN has " + e + "$" ); | |||
FreeSQLQuery( query ); | |||
}</source> |
Revision as of 10:35, 11 March 2016
Get a result row as a string.
Syntax
GetSQLColumnData( query, columnNumber )
Arguments
- query - Name of the previously executed query.
- columnNumber - Number of the column you want to get data of.
Return value
- The data in the column and/or null on failure
Example
local db = ConnectSQL( "db.db" );
local query = QuerySQL( db, "SELECT Cash FROM Accounts WHERE Name='KAKAN'" );
if ( query ) {
local data = GetSQLColumnData( query, 0 );
if( data ) print( "KAKAN has " + e + "$" );
FreeSQLQuery( query );
}