<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dzakub25</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dzakub25"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Dzakub25"/>
	<updated>2026-04-14T22:52:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DbExec&amp;diff=75320</id>
		<title>DbExec</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DbExec&amp;diff=75320"/>
		<updated>2022-07-30T14:21:49Z</updated>

		<summary type="html">&lt;p&gt;Dzakub25: Clarify what does &amp;quot;result&amp;quot; mean&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function executes a database query using the supplied connection. No query result is returned.&lt;br /&gt;
{{Tip|The server command [[Server_Commands#debugdb|debugdb 2]] will output verbose information on each query to a logging file (usually '''logs/db.log''')}} &lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dbExec ( element databaseConnection, string query [, var param1 [, var param2 ...]] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[connection]]:exec}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''databaseConnection:''' A database connection element previously returned from [[dbConnect]]&lt;br /&gt;
*'''query:''' An SQL query. Positions where parameter values will be inserted are marked with a '''?'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''paramX:''' A variable number of parameters. These must be strings or numbers - it is important to make sure they are of the correct type. Also, the number of parameters passed must be equal to the number of '''?''' characters in the query string.&lt;br /&gt;
String parameters are automatically quoted and escaped as required. (If you do not want a string quoted, use '''??''') Make sure that numbers are in number format as a string number is treated differently.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' unless the connection is incorrect, in which case it returns ''false''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example executes an INSERT query:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dbExec( connection, &amp;quot;INSERT INTO table_name VALUES (?,?,?)&amp;quot;, &amp;quot;aaa&amp;quot;, &amp;quot;bbb&amp;quot;, 10 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example shows how to use '''??''' for parts of the query that are not column values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dbExec( connection, &amp;quot;UPDATE ?? SET ??=?&amp;quot;, tableName, columnName, columnValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''''Note''': It is usually good practice to surround table and column names with backticks (`) in case they contain spaces or SQL keywords (and therefore cause syntax errors). This is especially true when using variables for table and column names, as potential problems may not be apparent when the script is first written.''&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows how to use backticks and '''??''' for parts of the query that are not column values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dbExec( connection, &amp;quot;UPDATE `??` SET `??`=?&amp;quot;, tableName, columnName, columnValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03341|n/a}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Registry_functions}}&lt;/div&gt;</summary>
		<author><name>Dzakub25</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=LoadBrowserURL&amp;diff=68079</id>
		<title>LoadBrowserURL</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=LoadBrowserURL&amp;diff=68079"/>
		<updated>2020-12-21T14:40:09Z</updated>

		<summary type="html">&lt;p&gt;Dzakub25: Add note about createBrowser being asynchronous, with reference to onClientBrowserCreated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
This function loads the specified URL.&lt;br /&gt;
{{Note|You should use [[requestBrowserDomains]] first to request permission to load the url on the client.}}&lt;br /&gt;
{{Note|Calling loadBrowserURL right after [[createBrowser]] will not work normally due to the nature of the asynchronous browser interface. Refer to [[onClientBrowserCreated]] for more information.}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool loadBrowserURL ( browser webBrowser, string url [, string postData = &amp;quot;&amp;quot;, bool urlEncoded = true ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:loadURL|url|getBrowserURL}}&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''webBrowser:''' The [[Element/Browser|browser]] element which will load the URL&lt;br /&gt;
*'''url:''' The url you want to load. It can either contain a remote website (&amp;quot;http://&amp;quot; prefix) or a website stored within a local resource (&amp;quot;http://mta/local/gui.html&amp;quot; for example, see [[Local_Scheme_Handler|Local Scheme Handler]] for details).&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''postData:''' The post data passed to the website. Its content type can be any type (e.g. JSON) if urlEncoded is set to ''false''&lt;br /&gt;
*'''urlEncoded:''' If set to ''true'', it will be available f.e. in PHP's $_POST variable (the content type is: ''application/x-www-form-urlencoded'')&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the URL was successfully loaded.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- In order to render the browser on the full screen, we need to know the dimensions.&lt;br /&gt;
local screenWidth, screenHeight = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
-- Let's create a new browser in local mode. We will not be able to load an external URL.&lt;br /&gt;
local webBrowser = createBrowser(screenWidth, screenHeight, false, false)&lt;br /&gt;
	&lt;br /&gt;
-- This is the function to render the browser.&lt;br /&gt;
function webBrowserRender()&lt;br /&gt;
	-- Render the browser on the full size of the screen.&lt;br /&gt;
	dxDrawImage(0, 0, screenWidth, screenHeight, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- The event onClientBrowserCreated will be triggered, after the browser has been initialized.&lt;br /&gt;
-- After this event has been triggered, we will be able to load our URL and start drawing.&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webBrowser, &lt;br /&gt;
	function()&lt;br /&gt;
		-- After the browser has been initialized, we can load our website.&lt;br /&gt;
		loadBrowserURL(webBrowser, &amp;quot;https://www.youtube.com/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
		-- Now we can start to render the browser.&lt;br /&gt;
		addEventHandler(&amp;quot;onClientRender&amp;quot;, root, webBrowserRender)&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{CEF_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:loadBrowserURL]]&lt;br /&gt;
[[RO:loadBrowserURL]]&lt;/div&gt;</summary>
		<author><name>Dzakub25</name></author>
	</entry>
</feed>