Forums

Form is not posting to Database

voipbazar 13 Apr, 2010
Hi GreyHead

I love your component, I have created a form alongwith database table. I have carefully checked all fields green when creating the table, Also I have enabled auto increment and primary key. Data storage is enabled before send email and I have selected the correct db table. I have also tried store data after and before send email.

I have read all your forums and have tried every possible suggesstions. But for some reasons my form does not want to store any data into the DB whatsoever.

I have spent more than 3 days figuring out where the underlying problem is, so far I have not succeeded. My programming skills are not that great but I am learning.

Here is the link to the form I have created. http://www.voipbazar.com/index.php?option=com_chronocontact&chronoformname=test

When the form is submitted I receive the email but for some reasons data does not get stored in the DB.

I hope you can help me resolve this problem, please?

Thank you

-Imran
Dingens 15 Apr, 2010
Hi,

I'm having the same problem. But then again, I've only been figuring out for the last two days. So I'm curious what might be the answer to your question. Maybe I run into a solution in the meantime.
nml375 15 Apr, 2010
Hi Imran & Dingens,
The most common cause for this behavior is mis-matched form field names and table field names. These must match to the letter and case.

Another common cause would be if you try to assign a value to the primary key, as this causes the JTable classes used by Joomla (and CF) to update a record rather than insert a new one.

/Fredrik
kitofers 29 Apr, 2010
Hi Imran & Dingens,

Have any of you run into a solution for your problem? I was having the same issue. Saving to DB started working as soon as I set up a proper e-mail and selected Saving Data/Emails order: After Email. Not sure which of the steps helped (I did NOT receive the e-mail), but the store to database worked after this.
Dingens 30 Apr, 2010
This week I solved the problem by deleting the database, creating a new one. I then made sure all fields were green. In the old database that did not happen. Every time I made the red figure green, by clicking on it, it was red again the next time I looked. So now it worked.
sunne 02 May, 2010

This week I solved the problem by deleting the database, creating a new one. I then made sure all fields were green. In the old database that did not happen. Every time I made the red figure green, by clicking on it, it was red again the next time I looked. So now it worked.




thank you 😀 😀
Dingens 02 May, 2010
@sunne
So this worked for you too? Maybe it is very important to set up your database with all the fields enabled. But then I wonder what happens if you change your mind along the way and want to enable or disable a field. Should you set up a new db then?
nml375 02 May, 2010
Hi Dingens,
You could use any DB-tool, or direct SQL-queries, to update the structure of your database table at any point in time. Some care should be taken though, as you might end up loosing previous data with certain operations:

Adding a new field ("column"):
The new field will be added to all the records in the table, though the value would be the default (or empty). Any new records would be filled with the submitted values.

Removing an old field ("column"):
The field, along with any data in it, will be removed from the table and is permanently lost. Any new records will not contain this field either. Re-creating the field will not restore any of the old data.

Renaming a field ("column"):
If done using the CHANGE SQL extension, the data should be untouched. Some tools however may simply create a new field and remove the old, resulting in data loss.


As mentioned before, when updating your database table structure, make sure the table field names exactly matches the form field names, or the submitted information will not be stored in the database.

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