Forums

Custom Made Forms not Saving to Database

bc86 21 Feb, 2011
Hello,

I've been using Chronoforms for the last year or so and absolutely love the component! Over the last few months I have also been learning about HTML/CSS etc. For example I created a form in which I want the DIVS to collapse/expand using javascript. Although it's not perfect, it fits my need as the website I am building will be a private for the company I work with.

When I went to create the table, I made most of my fields BLOBS and TEXT. However after setting up the table and enabling the database connection, upon submission the form would not go through.

At first I was getting a fatal PHP error, so I went back through my columns in my database and double checked to make sure there were no " - " in the input fields. (Which there weren't.)

I copied the custom HTML to my clipboard and deleted the form and the respective database from PHPMYADMIN. After creating the table a second time, I did not receive a PHP error, but the record still is not showing up in the database table.

This is very unusual as the data connection has worked previously for me. (I have 9-10 forms with enabled data storage.)

I did add a Chrono Plug-in to display my forms in articles earlier this past week, but I doubt the two issues are related.

I am now hoping someone will be able to shed the light on this subject, if not my next plan is to back-up all of my forms and re-install chronoforms.

I also wanted to mention I did not use the Wizard to create this forms, and the form is quite lengthy, easily over 100 fields. Not sure if the size has anything to do with the problem.

I apologize for the lengthy post, but I wanted to provide as much detail as possible.

Thanks in advance,

Brad
bc86 21 Feb, 2011
I also just turned on Debug and got the following message:

Parse error: syntax error, unexpected '$', expecting T_VARIABLE in /Applications/MAMP/htdocs/Baseball/components/com_chronocontact/chronocontact.php(53) : eval()'d code on line 120

   1. Form passed first SPAM check OK
   2. Form passed the submissions limit (if enabled) OK
   3. Form passed the Image verification (if enabled) OK
   4. Form passed the server side validation (if enabled) OK
   5. $_POST Array: Array ( [staff] => Another [date] => Attempt [team] => School 1 [opponent] => School 2 [player1] => Name Last, First [Bo] => random # [TPA] => random # [sacb] => random # [sf] => Random # [2khits] => Random # [2ORBI] => 2 [ppa1] => [ppa2] => [ppa3] => [PPA4] => [ppa5] => [ppa6] => [comm] => [player2] => [bo_a] => [TPA_A] => [sacb_a] => [sf_a] => [2khits_a] => [2ORBI_a] => [ppa1_a] => [ppa2_a] => [ppa3_a] => [ppa4_a] => [ppa5_a] => [ppa6_a] => [comm_a] => [player3] => [bo_b] => [TPA_B] => [sacb_b] => [sf_b] => [2khits_b] => [2ORBI_b] => [ppa1_b] => [ppa2_b] => [ppa3_b] => [ppa4_b] => [ppa5_b] => [ppa6_b] => [comm_b] => [player4] => [bo_c] => [TPA_C] => [sacb_c] => [sf_c] => [2khits_c] => [2ORBI_c] => [ppa1_c] => [ppa2_c] => [ppa3_c] => [ppa4_c] => [ppa5_c] => [ppa6_c] => [comm_c] => [player5] => [bo_d] => [TPA_D] => [sacb_d] => [sf_d] => [2khits_d] => [2ORBI_d] => [ppa1_d] => [ppa2_d] => [ppa3_d] => [ppa4_d] => [ppa5_d] => [ppa6_d] => [comm_d] => [player6] => [bo_e] => [TPA_E] => [sacb_e] => [sf_e] => [2khits_e] => [2ORBI_e] => [ppa1_e] => [ppa2_e] => [ppa3_e] => [ppa4_e] => [ppa5_e] => [ppa6_e] => [comm_e] => [player7] => [bo_f] => [TPA_F] => [sacb_f] => [sf_f] => [2khits_f] => [2ORBI_f] => [ppa1_f] => [ppa2_f] => [ppa3_f] => [ppa4_f] => [ppa5_f] => [ppa6_f] => [comm_f] => [player8] => [bo_g] => [TPA_G] => [sacb_g] => [sf_g] => [2khits_g] => [2ORBI_g] => [ppa1_g] => [ppa2_g] => [ppa3_g] => [ppa4_g] => [ppa5_g] => [ppa6_g] => [comm_g] => [player9] => [bo_h] => [TPA_H] => [sacb_h] => [sf_h] => [2khits_h] => [2ORBI_h] => [ppa1_h] => [ppa2_h] => [ppa3_h] => [ppa4_h] => [ppa5_h] => [ppa6_h] => [comm_h] => [player10] => [TPA_I] => [sacb_I] => [sf_I] => [2khits_I] => [2ORBI_I] => [ppa1_I] => [ppa2_I] => [ppa3_I] => [ppa4_I] => [ppa5_I] => [ppa6_I] => [comm_I] => [button_26] => Submit [273d5c6209254f02e217c095d1cd4a8d] => 1 [1cf1] => e1fa8776815348c056cf06ba0338b8d2 [chronoformname] => PDHD )
   6. $_FILES Array: Array ( )
   7. Form passed the plugins step (if enabled) OK
   8. Debug End


I didn't fill out all the fields because most of the time my staff will not be filling out all the fields as well. (They're there just in case there is a larger amount of data than expected.)
GreyHead 21 Feb, 2011
Hi bc86,

You've checked for dashed but there is something amiss with one of the last input names. It's probably going to be around the 110th input on the list - or there's a comma in an earlier one that throws the whole list out.

Ah - I may have spotted it, you have some input names starting with digits, these will create invalid PHP variable names. Digits are allowed in names but not as the first character.

Bob
bc86 21 Feb, 2011
Hi Greyhead,

Thanks for the quick response!

I took out the digits from the inputs, however it is still not saving the data to the database. I'll go through my code again to see if I can find the problem.

Thanks!
GreyHead 21 Feb, 2011
Hi bc86,

Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.

Bob
bc86 22 Feb, 2011
Greyhead,

I finally got my form to save. Not sure what the issue was, but I went ahead and used the form wizard to generate the html. Now I will add in the javascript and manipulate the HTML. Although it was tedious, I know can move forward making it appear the way I want it to.

Thanks for your help!
bc86 24 Feb, 2011
Greyhead,

At first I thought I had my form working correctly, however I went back in and edited the name of one of the fields, and even though I updated the table, I still cannot save to my database on PHPmyadmin. Would you mind taking a closer look? I know it's lengthy, but I'd really appreciate it.
GreyHead 24 Feb, 2011
Hi b86,

I'm sorry but life's too short to try to create a table for a 5,000 line form just to test a DB save. (With the ChronoForms default VARCHAR the table is too big for MySQL).

If you wan to send me the CREATE query than I'll look again.

Off the top of my head I'd say that the form needs some serious re-design. Not least to avoid repeating the same 200 long player option list ten times.

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