Query with Results

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "$Query with Results is a Database Command. - This command is used for running a query against a database and returning the results into a table. - It is...")
 
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
$Query with Results is a [[Database Commands|Database Command]].
+
Query with Results is a [[Database Commands|Database Command]].
  
- This command is used for running a query against a database and returning the results into a table.
+
* This command is used for running a query against a database and returning the results into a table.
- It is only usable inside of a connect to database Command.
+
* It is only usable inside of a connect to database Command.
- The Query parameter is used for typing your SQL query such as SELECT * FROM table_name;
+
* The Query parameter is used for typing your SQL query such as SELECT * FROM table_name;
- The Table parameter is used for defining the table where the results of your query will be stored.
+
* The Table parameter is used for defining the table where the results of your query will be stored.
 +
 
 +
== Example ==
 +
 
 +
<pre>
 +
plugin command("DatabaseCommands.dll", "connect to database", "server=localhost;uid=test; pwd=testing; database=mysql; port=3306; pooling=false") {
 +
    plugin command("DatabaseCommands.dll", "query", "INSERT INTO users VALUES (\'ubot\', \'studio\');")
 +
    plugin command("DatabaseCommands.dll", "query with results", "SELECT * FROM users WHERE username = \'ubot\';", &users)
 +
}
 +
</pre>
 +
 
 +
[[File:query.jpg]]

Latest revision as of 17:05, 26 September 2013

Query with Results is a Database Command.

  • This command is used for running a query against a database and returning the results into a table.
  • It is only usable inside of a connect to database Command.
  • The Query parameter is used for typing your SQL query such as SELECT * FROM table_name;
  • The Table parameter is used for defining the table where the results of your query will be stored.

[edit] Example

plugin command("DatabaseCommands.dll", "connect to database", "server=localhost;uid=test; pwd=testing; database=mysql; port=3306; pooling=false") {
    plugin command("DatabaseCommands.dll", "query", "INSERT INTO users VALUES (\'ubot\', \'studio\');")
    plugin command("DatabaseCommands.dll", "query with results", "SELECT * FROM users WHERE username = \'ubot\';", &users)
}

Query.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox