Forums

DB Save records empty

aliduz 27 Jun, 2014
Hi,

I've run into a problem using the DB Save in Chronoform V5
It seems that the record is saved but when I enter the record to review the information the record is empty...

Any assistance would be much appreciated.

feel free to review the form http://www.theaccf.com.au and click New Member application.

Thanks again
Ali
GreyHead 27 Jun, 2014
HI aliduz,

Please drag a Debugger action into the On Submit event, then submit the form and post the debug - including the 'dummy emails' results here.

Note: if you are using the Easy Wizard you can turn on Debug on the Others tab in CFv4 or the Setup tab in CFv5.

Bob
aliduz 27 Jun, 2014
Data Array
Array
(
    [option] => com_chronoforms5
    [chronoform] => memberapp
    [event] => submit
    [0] => Single
    [1] => 0449779826
    [2] => 
    [3] => 
    [4] => 
    [5] => 
    [6] => 
    [7] => Yes
    [8] => 1
    [9] => Yes
    [10] => Conf
    [11] => 
    [12] => Yes
    [13] => Yes
    [14] => 
    [captcha] => 
    [15] => Submit Application
    [16] => Single
    [17] => 0449779826
    [18] => 
    [19] => 
    [20] => 
    [21] => 
    [22] => 
    [23] => Yes
    [24] => 1
    [25] => Yes
    [26] => Conf
    [27] => 
    [28] => Yes
    [29] => Yes
    [30] => 
    [31] => Submit Application
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
    [8] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `ts4bl_chronoengine_chronoforms_datatable_memberapp` (`user_id`, `created`) values ('0', '2014-06-27 10:40:05');
                        )

                )

        )

)
Powered by ChronoForms - ChronoEngine.com
GreyHead 27 Jun, 2014
Hi Ali,

Form input names and MySQL column names must start with a letter, if they are called 1, 2, 3, . . . as they appear to be here then nothing will work correctly.

Bob
aliduz 27 Jun, 2014
interesting thanks!

So will just going through the wizard and adding a letter prefix resolve my issue?
GreyHead 27 Jun, 2014
Hi Ali,

Probably, but I would change then names and ids to be meaningful so call the 'email' input email and not something like k2

Remember that you will also need to rename the database table columns to match - it may be easier to create a new table.

Bob
aliduz 27 Jun, 2014
ok will do going through it and doing it all now,

Will report back with results.
aliduz 27 Jun, 2014
Ok, thanks for your help so far. This is whats happening

my debug is showing

Data Array
Array
(
[option] => com_chronoforms5
[chronoform] => memberapp
[event] => submit
[MT] => Single
[SJI] => 0449779826
[FI] =>
[FI2] =>
[FI3] =>
[FI4] =>
[FI5] =>
[CCOWN] => Yes
[CCNU] => 1
[ATVY] => Yes
[WHICH] => Conf
[OTHER] =>
[HELP] => Yes
[AGREE] => Yes
[LEGAL] =>
[captcha] =>
[SUBMIT] => Submit Application
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
[11] => Array
(
[DB Save] => Array
(
[Queries] => Array
(
[0] => INSERT INTO `ts4bl_chronoengine_chronoforms_datatable_memberapp` (`captcha`, `user_id`, `created`) values ('', '0', '2014-06-27 13:03:15');
)

)

)

)
Powered by ChronoForms - ChronoEngine.com


Also when I attempt to access the table from the Chronoform drop down I get

An error has occurred.
0 SQL=SELECT `ListData`.`id` AS `ListData.id`, `ListData`.`uniq_id` AS `ListData.uniq_id`, `ListData`.`user_id` AS `ListData.user_id`, `ListData`.`created` AS `ListData.created`, `ListData`.`modified` AS `ListData.modified`, `ListData`.`1` AS `ListData.1`, `ListData`.`2` AS `ListData.2`, `ListData`.`3` AS `ListData.3`, `ListData`.`4` AS `ListData.4`, `ListData`.`5` AS `ListData.5`, `ListData`.`6` AS `ListData.6`, `ListData`.`7` AS `ListData.7`, `ListData`.`8` AS `ListData.8`, `ListData`.`9` AS `ListData.9`, `ListData`.`10` AS `ListData.10`, `ListData`.`11` AS `ListData.11`, `ListData`.`12` AS `ListData.12`, `ListData`.`13` AS `ListData.13`, `ListData`.`14` AS `ListData.14`, `ListData`.`15` AS `ListData.15`, `ListData`.`16` AS `ListData.16`, `ListData`.`captcha` AS `ListData.captcha`, `ListData`.`54` AS `ListData.54` FROM `ts4bl_chronoengine_chronoforms_datatable_memberapp` AS `ListData` LIMIT 30
GreyHead 27 Jun, 2014
Hi aliduz,

It looks as though you haven’t changed the MySQL column names if you are seeing `ListData`.`1`

Bob
aliduz 27 Jun, 2014
hmm I deleted the previous table and created a new table once I had made all the alterations to the form.
GreyHead 27 Jun, 2014
Hi Ali,

If the form still connected to the old (now deleted) table?

Bob
aliduz 27 Jun, 2014
Okay, I've made some progress.

I can access the the table now without any sql errors, however there is still no data captured in the

Data Array
Array
(
    [option] => com_chronoforms5
    [chronoform] => memberapp
    [event] => submit
    [MT] => Single
    [SJI] => 0449779826
    [FI] => 
    [FI2] => 
    [FI3] => 
    [FI4] => 
    [FI5] => 
    [CCOWN] => Yes
    [CCNU] => 1
    [ATVY] => Yes
    [WHICH] => Conf
    [OTHER] => 
    [HELP] => Yes
    [AGREE] => Yes
    [LEGAL] => 
    [captcha] => 
    [SUBMIT] => Submit Application
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
    [11] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `ts4bl_chronoengine_chronoforms_datatable_memberapp1` (`user_id`, `created`) values ('0', '2014-06-27 13:52:37');
                        )

                )

        )

)
Powered by ChronoForms - ChronoEngine.com
GreyHead 27 Jun, 2014
Hi Ali,

That is still what I would expect to see if the column names and the input names aren't exactly the same?

Bob
aliduz 27 Jun, 2014
Just reviewed it all and it all seems to match....Maybe I'm missing something but I just cant see it...
GreyHead 28 Jun, 2014
Hi Ali,

By all means email or PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.

Bob
GreyHead 28 Jun, 2014
Hi Ali,

It's working now, though I suspect there are a few more wrinkles to iron out.

You had the DB Save action set to use a Model ID - that means that ChronoForms looks for a sub-array of the form data with the same name as the Model ID. But there was no such sub-array so there was nothing to save.

I disabled the Model ID setting and the form data is now saving.

Bob
aliduz 28 Jun, 2014
Thats really helpful I Imagine at one stage I began changing options to try and get it going..

My final challenge and issue is I have multiple fields which utilise the same field id E.G. SJI but the DB save is only capturing the field with the Phone number Label.

Using the same field id simplifies creating events, have I come across a limitation or am I able to get around this?
GreyHead 28 Jun, 2014
Hi Ali,

A form input has two possible identifiers: a name and an id. i

In HTML id's *must* be a unique identifier. That is - no other element on the page can use the same id.

ChronoForms uses the name attribute to identify data. You can have more than one form input with the same name **but** only the last one will be submitted. f you want to use the same name with more than one element then you can do that y using an 'array' name e.g. input_name[] That will then return an array of results and you have to decide as a part of your form planning and design how you want to handle the array after the form is submitted.

Bob
This topic is locked and no more replies can be posted.