Online
Manual / Configuration
Files / Querying a MySQL database.
Command:
mySQL
Usage:
Allows
you to query a MySQL database which will allow you to store form results.
Arguments:
- page="<form page number>"
Specify the form page number to tell the script when to execute the command. This command will apply after the form is submitted on this form page.
- hostname="<server>"
Specify the MySQL server's remote address whether it's local or remote.
- username="<username>"
Specify the username that will be used to access the MySQL server.
- password="<password>"
Specify the password that will be used to access the MySQL server.
- database="<database>"
Specify the name of the MySQL database to query.
- query="<query>"
Specify the query to execute on the MySQL database.
Example:
| mySQL page="1" hostname="localhost" username="example" password="password" database="example_db" query="INSERT INTO `contacts` (`name`, `email`, `comments`) VALUES ('[output type="variable" name="Full Name"]', '[output type="variable" name="E-mail"]', '[output type="variable" name="Comments"]')" |
In this example we query our local MySQL database. We've added a query to add information to our contacts table in our example_db database. The information we are adding here are the Full Name, E-mail, and Comments. Noticed how we added the form field outputs for the VALUES portion of the query.
|