Show saved data not working

Heilong 14 Jul, 2008
Hello everyone,

I read a post about adding addslashes around fields to be saved into the database, but when my form is submitted no data are saved in my database, so show saved data view cannot display anything.

I entered some data using phpmyadmin directly in the concerned table, the show saved data is working, so I guess when filling the form and submitting the form there is a problem but I can't figure it out.

Would you guys please help me, i'm usign Joomla 1.5.4 and Chronoforms v2.5 [file name=application_form-8ef34e7747c92245a8ca54718415357f.cfbak size=111484]http://www.chronoengine.com/images/fbfiles/files/application_form-8ef34e7747c92245a8ca54718415357f.cfbak[/file]
Max_admin 14 Jul, 2008
Hi Hilong,

I made a quick look and couldn't find anything, so I suggested you do this and provide me with your results:

open your form in Firefox and assure that you have Firebug extension for firefox installed and ENABLED for all websites, submit the form, can you see firebug reporting any javascript errors? (by turning its icon at the bottom right to red)

this will mean a JS error and most probable an error with the SQL statement, just let me know and then we can move from there!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 17 Jul, 2008
Hi Hilong,

Your form saves some simple data OK for me.

However, you do seem to have the whole MooTools library in the JavaScript box and this may well be casuing some conflicts on your site. If you have Joomla 1.5 then MooTools is probably loaded already.

Bob
greenkoi 28 Jul, 2008
I'm running into a similar issue.

I've been using Chronoforms for a some time and loving it. Check out the goods at:

http://www.thedonorsolution.com/index.php?option=com_chronocontact&chronoformname=app

Funny thing is happening though. The forms are sending the eMials, but not writing to the DB. Since I was getting the eMail forms, I didn't suspect anything being amiss. . .

By way of testing, I copied the form, and the new form is working as it should. So I thought about just exporting and importing the data from the old table into the new one, but I would like to avoid that and hopefully resolve the issue with the form writing to the DB.

As in the earlier message, I adjusted the validation rules to see if that was the culprit, either by turning it off or switching it to Mootools, but still no luck.

Any other suggestions on where I should look ?
GreyHead 28 Jul, 2008
Hi greenkoi,

Almost impossible to say what's happening. The form is very detailed but I don't see anything much wrong when scanning the source. A view of the $_POST array might tell some more.

If the new form is working Ok then why not use that, you can edit the table name in the Autogenerated tab code to point to the old table and save the data there. If that doesn't work than you've probably got a table mismatch because the form has been edited after the table was created.

Bob

PS I did notice that your <textarea> tags don't have closing </textarea> tags. They aren't self-closing like input /> tags, the syntax is <textarea . . .>value</textarea>. And the multiple select question on ethnicity will only return a single option unless you use an array name (and unpack it before saving to the database).
greenkoi 28 Jul, 2008
Bob -

Thanks for your reply. I misspoke in my earlier post. The copied form is NOT storing data correctly either.

I updated the site from 1.0.13 to 1.0.15 thinking there might be something going on there, but still no luck.

Digging around more and reading other posts, I turned on debugging and found something interesting when viewing the page with the form:

Notice: Table 'donorsolution.jos_chrono_contact_plugins' doesn't exist in /home/content/m/a/r/mary3759/html/includes/database.php on line 307

/home/content/m/a/r/mary3759/html/includes/database.php:498
/home/content/m/a/r/mary3759/html/components/com_chronocontact/chronocontact.html.php:63
/home/content/m/a/r/mary3759/html/components/com_chronocontact/chronocontact.php:148
/home/content/m/a/r/mary3759/html/components/com_chronocontact/chronocontact.php:31
/home/content/m/a/r/mary3759/html/index.php:236

What is the above telling me? And how do I go about remedying it ?

Thanks again for your assistance !
GreyHead 28 Jul, 2008
Hi greenkoi,

That error says that the ChronoForms plugin table is missing. Most likely from a faulty install, or an upgrade that didn't create the table.

It's easy enough to fix with this sql (from chronocontact.xml). Just run it in PHPMyAdmin
CREATE TABLE `#__chrono_contact_plugins` (
			  `id` int(11) NOT NULL auto_increment,
			  `form_id` int(11) NOT NULL,
			  `name` varchar(255) NOT NULL,
			  `event` varchar(255) NOT NULL,
			  `params` longtext NOT NULL,
			  `extra1` longtext NOT NULL,
			  `extra2` longtext NOT NULL,
			  `extra3` longtext NOT NULL,
			  `extra4` longtext NOT NULL,
			  `extra5` longtext NOT NULL,
			  PRIMARY KEY  (`id`));
In your case replace the #__chrono . . . with jos_chrono . . .

That doesn't explain why your form data isn't being saved though.
Bob
greenkoi 28 Jul, 2008
Thanks for your replies. They really are appreciated.

Further testing yielded some positive results. Instead of copying the form using the interface, I copied the form code and created a new form, then created the table to hold the data. This is working. Yeah!

Now I'll simply import the existing records into the new table and I should be good to go.

As you mentioned previously, there was a change to the table structure that I made a bit foolishly.

So the lesson here is to not do that . . . 😶
GreyHead 28 Jul, 2008
Hi greenkoi,

No problem in changing the table structure - as long as you follow through and change the autogenerated code to match :-)

Bob
greenkoi 28 Jul, 2008
Ahh yes. That does make sense now.

BTW - since we're on the subject of making changes to the form / table I was thinking now would be a good time for me to expand on some of the fields I have in the form.

That being said, what would be the best way / tool to use to map the data from the old table to the new one? In testing I've run into issues using export / import with PHPMyAdmin as the table structure is different.

Know any good tuts that cover this?

I'm asking here as I'm guessing some others might be facing a similar issue.
GreyHead 28 Jul, 2008
Hi greenkoi,

That depends a bit on where your databases are and how much data there is in them.

For most typical Joomla style on-line databases you can do all of the editing you need with tools like PHPMyAdmin. I prefer the free MySQL Query Browser and Administrator which run as Windows desktop tools and are more friendly than PHPMyAdmin (though they do more or less the same thing). If you want real luxury then you can download a 30 day free trial of NaviCat which is a 'spreadsheet' like tool.

Whatever you do take a database backup first. If the database is big, or the on-line connection is too slow then you can restore a copy on a local installation of MySQL whicl you make the changes then restore back on-line.

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

VPS & Email Hosting 20% discount
hostinger