Online Chat
 Call Us: 
Browse Submit a Ticket
Advanced Search
Rss Categories

Database Storage

Author: Eileen Wilde Reference Number: AA-00155 Views: 15349 Last Updated: 07/31/2012 03:26 PM 50 Rating/ 3 Voters

You may execute any database query after each form submission to save user input to your database.

  1. MySQL
  2. PostgreSQL
  3. MS SQL
  4. SQLite
  5. ODBC
  6. Oracle


Use a “mysql_query” action to save data to a MySQL database. This action works with INSERT and UPDATE queries. If you want to get data from a MySQL database, please use the "Database Select action". If you want to select and update several entries of your MySQL database at one time, please read the section "MySQL selection and update of several entries".


mysql_query = <query>

“query” may be any valid MySQL query.


mysql_query = INSERT INTO mytable (name, email) VALUES ("{#name#}", "{#emai#}")[; varible_name]

The variables {#name#} and {#email#} will be changed to the user submitted data on the “name” and “email” fields.

Optional parameter varible_name allows to specify name of variable (field name) where id of inserted row will be placed after query executes. You can then show this id on thank you page or send in email. Also you can use it to build url for direct access to this record or any other usage.

To show contents of this variable use {#varible_name#}

To set MySQL hostname, username, and password use the following settings in your config.php file:

mysql_host = MySQL hostname
mysql_user = MySQL username
mysql_password = MySQL password
mysql_db = the name of MySQL database to be used

These settings are common for for all forms and must be set in the first section of config.php (global section) before the individual form configuration blocks.


PostgreSQL query executor.


pgsql_query = <query>

<query> is any valid PostgreSQL query.


pgsql_query = INSERT INTO test (name, email) VALUES ("{#name#}", "{#email#}");

Additional settings:

pgsql_host = PostgreSQL hostname
pgsql_user = PostgreSQL user
pgsql_password = PostgreSQL password
pgsql_db = PostgreSQL database name


Microsoft SQL query executor.


mssql_query = <query>

Where <query> is any valid Microsoft SQL query.


mssql_query = INSERT INTO test (name, email) VALUES ("{#name#}", "{#email#}");

Additional settings:

mssql_host = Microsoft SQL hostname
mssql_user = Microsoft SQL user
mssql_password = Microsoft SQL password
mssql_db = Microsoft SQL database name


SQLite query executor.


sqlite_query = <query>

Where <query> is any valid SQLite query.


sqlite_query = INSERT INTO test (name, email) VALUES ("{#name#}", "{#email#}");

Additional settings:

sqlite_file = SQLite filename


ODBC SQL query executor.


odbc_query = <query>

Where <query> is any valid SQL query.


odbc_query = INSERT INTO test (name, email) VALUES ("{#name#}", "{#email#}");

Additional settings:

odbc_dsn = ODBC DSN value


Queries to an Oracle database.

First, setup database connection details:

oracle_dsn = server_address (e.g. dbs/oracle)
oracle_user = login
oracle_password = password

Then you can use oracle_query action to run queries.


oracle_query = INSERT INTO test_fpp VALUES ('{#firstname#}', '{#email#}', '{#subject#}', '{#comment#}')

Database storage support is only available with the following licenses: Business, World Wide, ISP.