<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=DbQuery</id>
	<title>DbQuery - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://g1r-mp.com/wiki/index.php?action=history&amp;feed=atom&amp;title=DbQuery"/>
	<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=DbQuery&amp;action=history"/>
	<updated>2026-08-05T03:55:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://g1r-mp.com/wiki/index.php?title=DbQuery&amp;diff=46&amp;oldid=prev</id>
		<title>QCherry: Automatyczna aktualizacja dokumentacji funkcji</title>
		<link rel="alternate" type="text/html" href="https://g1r-mp.com/wiki/index.php?title=DbQuery&amp;diff=46&amp;oldid=prev"/>
		<updated>2026-08-04T12:44:10Z</updated>

		<summary type="html">&lt;p&gt;Automatyczna aktualizacja dokumentacji funkcji&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- This page is generated automatically from the function definition: dbQuery. --&amp;gt;&lt;br /&gt;
= dbQuery =&lt;br /&gt;
Starts an asynchronous prepared SQL query.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DatabaseQuery dbQuery([function callback, table callbackArguments,] DatabaseConnection connection, string statement, ...)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Type !! Required !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;callback&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;function&amp;lt;/code&amp;gt; || no || Optional function called when the result becomes available.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;callbackArguments&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || no || Optional values passed to the callback after the query handle.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;connection&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;DatabaseConnection&amp;lt;/code&amp;gt; || yes || The connection used to execute the query.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;statement&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || yes || SQL containing &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt; value placeholders.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;...&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;nil/bool/number/string&amp;lt;/code&amp;gt; || no || Values bound to the statement placeholders.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Returns a &amp;lt;code&amp;gt;DatabaseQuery&amp;lt;/code&amp;gt; handle on success, or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if the query could not be queued.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
Load one player asynchronously:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot; line&amp;gt;&lt;br /&gt;
dbQuery(function(query)&lt;br /&gt;
    local rows = dbPoll(query, 0)&lt;br /&gt;
    if rows then&lt;br /&gt;
        for _, row in ipairs(rows) do&lt;br /&gt;
            print(row.name, row.level)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end, {}, db, &amp;quot;SELECT name, level FROM players WHERE id = ?&amp;quot;, playerId)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* Available only in server-side resource scripts.&lt;br /&gt;
* Prefer the callback form so that the server script does not block while waiting for the database.&lt;br /&gt;
&lt;br /&gt;
[[Category:Server Functions]]&lt;br /&gt;
[[Category:Database Functions]]&lt;/div&gt;</summary>
		<author><name>QCherry</name></author>
	</entry>
</feed>