Buy Now
Sign in

FForm enhancement - write to db

StephLocke , June 30 2014
S
StephLocke
I have a form that I would like performing a database save on submit but I'm having no luck getting this set up with sensible datatypes.

I'm hoping someone here can spin the form up configure it correctly, and send me a backup of the revised form plus the SQL for creating the table in the database.

Hopefully this is a small task - I'm happy to pay $15 to the person who can do this.

Form cannot be attached - link is https://www.dropbox.com/s/ny8ypk7fguqvwjt/speakerform.cf5bak
GreyHead
Hi StephLocke,

Here's the MySQL Create statement - you may need to tweak the column sizes to get what you need, and replace the table prefix xxxxx with yours.
CREATE TABLE `xxxxx_chronoengine_chronoforms_datatable_SpeakerSubmissionWIP` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniq_id` varchar(50) NOT NULL,
`user_id` int(11) NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` datetime DEFAULT NULL,
`FirstName` varchar(32) NOT NULL,
`LastName` varchar(32) NOT NULL,
`EmailAddress` varchar(64) NOT NULL,
`ConfirmEmailAddress` varchar(64) NOT NULL,
`AboutYou` text NOT NULL,
`Website` varchar(64) NOT NULL,
`LinkedIn` varchar(64) NOT NULL,
`Facebook` varchar(64) NOT NULL,
`TwitterHandle` varchar(64) NOT NULL,
`AvailableAt` varchar(64) NOT NULL,
`ExtraTime` varchar(64) NOT NULL,
`SessionTitle1` varchar(64) NOT NULL,
`SessionType1` varchar(64) NOT NULL,
`SessionLevel1` varchar(64) NOT NULL,
`SessionAbstract1` text NOT NULL,
`SessionTitle2` varchar(64) NOT NULL,
`SessionType2` varchar(64) NOT NULL,
`SessionLevel2` varchar(64) NOT NULL,
`SessionAbstract2` text NOT NULL,
`SessionTitle3` varchar(64) NOT NULL,
`SessionType3` varchar(64) NOT NULL,
`SessionLevel3` varchar(64) NOT NULL,
`SessionAbstract3` text NOT NULL,
`SessionTitle4` varchar(64) NOT NULL,
`SessionType4` varchar(64) NOT NULL,
`SessionLevel4` varchar(64) NOT NULL,
`SessionAbstract4` text NOT NULL,
`SessionTitle5` varchar(64) NOT NULL,
`SessionType5` varchar(64) NOT NULL,
`SessionLevel5` varchar(64) NOT NULL,
`SessionAbstract5` text NOT NULL,
`SessionTitle6` varchar(64) NOT NULL,
`SessionType6` varchar(64) NOT NULL,
`SessionLevel6` varchar(64) NOT NULL,
`SessionAbstract6` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

The form is unchanged except that I added a DB Save action after the Handle Arrays action and linked it to this table.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
S
StephLocke
Hi Bob, I've encountered a problem with this that I had previously when I attempted to do the save by myself.

It did the first insert fine, but subsequent ones appear to be doing an update to an ID that don't exist. I get something along the lines of
UPDATE `sqlrelay_chronoengine_chronoforms_datatable_SessionSubmission2` AS `Data` SET `button27` = 'Submit', `YourName` = 'aaa', `email` = aa@aa.com, `Twitter` = ' @aa', `LinkedIn` = 'aaa', `Website` = 'http://aaa, `bio` = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', `Sessiontitle` = '', `Sessionabstract` = '', `sessiontype` = 'DBA', `sessionlevel` = 'Beginner', `sessiontitle2` = '', `sessionabstract2` = '', `sessiontype2` = 'DBA', `sessionlevel2` = 'Beginner', `user_id` = '0', `modified` = '2014-06-27 18:36:58' WHERE `id` = '112';


I c&p'd this from a debug of an earlier iteration of the form
GreyHead
Hi StephLocke,

This may be the problem with Article IDs interfering. Are you running the form from an article page with id=?? in the URL? If so. please try recreating the table using cf_id
  `cf_id` int(11) NOT NULL AUTO_INCREMENT,
. . .
PRIMARY KEY (`cf_id`)


Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much