sql/QueryRow

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Func |Name=QueryRow |Parent=sql |Description= |Realm=Shared |IsClass=No }} ")
 
m (Also menu state)
 
(One intermediate revision by one user not shown)
Line 2: Line 2:
 
|Name=QueryRow
 
|Name=QueryRow
 
|Parent=sql
 
|Parent=sql
|Description=
+
|Description=Performs the query like {{LibraryFunction|sql|Query}}, but returns the first row found.<br>
|Realm=Shared
+
Basically equivalent to<pre>sql.Query("*query* LIMIT 1")</pre>
 +
|Realm=Shared and Menu
 
|IsClass=No
 
|IsClass=No
 +
}}
 +
{{Arg
 +
|type=string
 +
|name=query
 +
|desc=The input query
 +
}}
 +
{{Arg
 +
|type=number
 +
|name=row
 +
|desc=The row number. Say we receive back 5 rows, putting 3 as this argument will give us row #3.
 +
|default=1
 +
}}
 +
{{Ret
 +
|type=table
 +
|desc=The returned row.
 
}}
 
}}

Latest revision as of 03:38, 24 July 2016

 sql.QueryRow( )

Contents

Description

Performs the query like sql.Query, but returns the first row found.

Basically equivalent to
sql.Query("*query* LIMIT 1")

Arguments

string query

The input query

Arguments

number row=1

The row number. Say we receive back 5 rows, putting 3 as this argument will give us row #3.

Returns

table

The returned row.
Personal tools
Navigation