Database mappings
A mapping writes the answers of a form into a database table, for example to add a row to the table of another extension. Mappings are on the Submission tab, sub-tab Mappings.
JoomForms warns you on this tab: a wrong mapping can change or delete data in other tables. Make a database backup before you test one.
Add a mapping
- Click New Query.
- Choose the Connection type: Local (your Joomla database) or Remote (another database, with Host, Port, Driver, Username, Password and Database).
- Choose the Method: Insert, Update, Delete or Replace.
- Pick the Database table.
- For each column to fill (the SET part), enter a value. Values can be placeholders such as
{Email:value}. - For Update and Delete, set the WHERE part: a column, an operator (Equals, Not equals, Greater than, Less than, Equals or greater than, Equals or less than, Like, Starts with, Ends with) and a value, joined with AND or OR.
- Save.
Values are escaped before they are written, so a visitor's answer cannot change the query.
Several mappings
Mappings run one after the other, in the order of the list. The placeholder {last_insert_id} holds the ID of the row the previous Insert created, so a second mapping can link to it.
When mappings run
After the emails are sent, and before Post to Location. They run even when Save Data To Database is set to No. See After submission.