Is it possible to use Form Builder to create a form then save the results to a database table of your choice?
I've created a database table with 4 fields, then used Formbuilder so when I submit the form the results get saved in this table?
Adding form results to a database table?
Re: Adding form results to a database table?
Read Help for FormBuilder
Code: Select all
*Store Results in Database. This will store the form contents in an internal database. You will always use this disposition if you use the form with FormBrowser.
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Re: Adding form results to a database table?
That was my first reaction too but I deleted it The thing is that stores the result in the database for use by the FormBrowser module, not in a table by choice.Coldman wrote: Read Help for FormBuilder
Code: Select all
*Store Results in Database. This will store the form contents in an internal database. You will always use this disposition if you use the form with FormBrowser.
The solution would be something like adding a field with type:
and creating an UDT looking something like this:*Call A User Defined Tag With the Form Results
Code: Select all
global $gCms;
$db =& $gCms->GetDb();
$query = "INSERT INTO test (name, birthdate, email) VALUES ({$param['name']}, {$param['birthdate']}, {$param['email']})";
$db->Execute($query);
Kind regards,*Call a User Defined Tag With the Form Results. This submits all the form results to the User-Defined Tag you specify. The UDT can handle the results however it wants. Values are passed as $param['field_name'].
D
Re: Adding form results to a database table?
Dee wrote:Code: Select all
global $gCms; $db =& $gCms->GetDb(); $query = "INSERT INTO test (name, birthdate, email) VALUES ({$param['name']}, {$param['birthdate']}, {$param['email']})"; $db->Execute($query);
I think it should be $params
/Coldman
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Re: Adding form results to a database table?
Correct it's a typo in the help, they are assigned as $params['Field Name']Coldman wrote: I think it should be $params
/Coldman
Regards,
D
Re: Adding form results to a database table?
btw Dee you have right about this.
UDT is the answer to his question and I'm man enough to admit my error .
/Coldman
UDT is the answer to his question and I'm man enough to admit my error .
/Coldman
Important Code of Conduct
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button
Why don't use CMSMS Docs or search?
Do you read Help?
Admin for Swedish Translations Team
Moderator Swedish Forum
After your problem is solved, push the green button