Scripting/Squirrel/Functions/GetSQLNextRow: 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 "Calling GetSQLNextRow switches from the current row in a query to the next row, which allows you to read from that row with GetSQLColumnData. == Syntax == <pre>function GetS...")
 
No edit summary
Line 28: Line 28:


{{Scripting/Squirrel/Functions/SQLite Functions}}
{{Scripting/Squirrel/Functions/SQLite Functions}}
== Related Functions ==
{{Scripting/Squirrel/Functions/SQLite Functions}}
[[Category:Scripting/Squirrel/Functions/SQLite _Functions]]

Revision as of 19:02, 30 January 2017

Calling GetSQLNextRow switches from the current row in a query to the next row, which allows you to read from that row with GetSQLColumnData.

Syntax

function GetSQLNextRow( query )

Arguments

  • Query - A reference to the query that was previously executed.

Example

function GetAlias( uniqueid )
{
	local query = QuerySQL(sdb, "SELECT namecolumn FROM tablename WHERE uniqueidcolumn = '" + uniqueid + "'"); // Selects all the rows that has the same uniqueid as the entered value.
	local string = GetSQLColumnData(query, 0); // Stores the first name.
	
	while (GetSQLNextRow(query)) // Gets the second name when the loop starts and continues getting the next row after that until no rows are left.
	{
		
		string += ", " + GetSQLColumnData(query, 0);
	}
	string += ".";
	return string; // Returns the string containing the aliases. 
}

Related Functions

Related Functions