Forums

Databases: Storing the Info in new DB?

zoomlanski 23 Nov, 2008
Already, I'm on to stage 2 of learning chronoforms.

I want to store the submission informatio to a database.

When I click on the tab - DB Connection, I get a list of all sorts of Dbases. Jos-this, Jos-that. But I can't find one that seems safe to use for Chronoforms. I'm hoping to name it new somthing like CF_connection1

I have access to PHPmyAdmin, and can view and save my DBs once created. I found the listing of Chronoforms in the Jos directory.
How do I create a new DB for CF data submitted in a form?

Thanks
Tim
GreyHead 23 Nov, 2008
Hi zoomlanski,

In the Forms Manager click the check-box by your form then the 'Create Table' icon and CF will let you select the fields you want from your form and create a new table for you.

Bob
zoomlanski 23 Nov, 2008
Brilliant absolutely brilliant!

Stupid question of the day - is there not a manual that outlines? I thought I reviewed all the instructions I could find. But maybe I'm looking in the wrong spot.

Thanks
Tim
zoomlanski 23 Nov, 2008
All registered. I love supporting programs that work.
Please keep it up the awesomeness!

Tim
Max_admin 23 Nov, 2008
Hi Tim,

Thanks for the support, I'm planning to put more detailed tutorials after the coming release!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
zoomlanski 24 Nov, 2008
I get one step ahead and two steps behind. The information is not recording to the database.
I have it connected in the table, I can download the excel/csv files, but they are empty.

Did I miss a checkmart somewhere? Miss some coding connection?

?Stumped?
Tim
DreamRaven 24 Nov, 2008
Hi

A relatively new ChronoForms user, but more experienced with both PHP and Joomla.

I have created a couple of forms, both with a HTML text editor 'cut and paste' along with the wizard.

In all cases, whilst I have succeeded in creating a table and attaching it to a form, and have experimented with 'no email' and 'data before email' and 'data after email' at no point in time does the script/component/plugin save data to the database.

The last attempt I tried with a VERY simple form, one field, submit, no data saved to the form.

What am I missing? I have not messed with the AutoGenerated code in this last form.

I am on Joomla 1.5, ChronoForm 3, PHP 4 and MySQL 3.2.3 (have used TYPE rather than ENGINE)

HEEEEELLLLPPPP!

Cheers
Keiran
zoomlanski 24 Nov, 2008
I switched the option to save to database before sending the email,versus after sending and it did save it to the table. This should probably be a default of saving to a table, once a DB is created.

I'm waiting for the next users' form submission to see if it continues to work properly. Some of the information appears coded, but something is better than nothing. Now that I know how to create/publish/save, if I run through the whole process start-to-finish next time, I anticipate I won't as many any stumbling blocks and the process should be cleaner and correct overall.

Tim
DreamRaven 25 Nov, 2008
Tim,

I Thought along those lines too, but to no avail. Nothing gets saved to the database, no matter what I try. Conversely, I also do not get a single error on submission either.

The email function works, when I choose to use it, passing the expected received data along on the email, but it does not save the data to the database.

Anyone have any other tips?

Cheers
Keiran
GreyHead 25 Nov, 2008
Hi Kieran,

Please take a backup copy of your form using the Backup inon in the Forms Manager and post a zipped copy of the .cfbak file here for us to look at (or email to me at the address in my sig if there's confidential info in there).

Bob
DreamRaven 25 Nov, 2008
I have got four forms, all doing the same thing (or not doing the same thing!). I am posting the simplest, a form of one field (an email field) a submit button and a text field built using the wizard. I am guessing if we can fix this situation it should fix the others (more important forms), but lets start with the simple one.

Cheers
Keiran
GreyHead 25 Nov, 2008
Hi Kieran,

I got this to work but it's a bit arcane!

You have to do the following:[list]
  • Create the table in the Forms Manager
  • Go to the DB Connection tab, set 'Enable Data Storage' to 'Yes, and select the new database table jos_chronoforms_test in this case
  • Go to the Autogenerated Code tab and set the Order to 'After Email' ('Before Email' will only work if 'Email the results' is set to Yes in the General tab AND an email is enabled)
  • [/list]Bob
    DreamRaven 25 Nov, 2008
    Ok!

    That worked, on the simple form.

    To summarise:
    - You have to set the data save to 'after email' even though you are not sending an email
    - Make the table in Chrono Form (which I did)
    - Choose the table and tell Chrono Form to save the table (also done in the first place)

    So, all the above works for a form that I created through the wizard and used ChronoForm to attach to the database.

    I have attached another backup zip for a more complex form, cut and paste through DreamWeaver and with some extra code, which, although I have followed the above instructions, still doesn't work!

    I know I am missing something

    Keiran
    GreyHead 25 Nov, 2008
    Hi kieran,

    This one fails (first) for quite a different reason - the message is

    Fatal error: Call to a member function setQuery() on a non-object in D:\xampp\htdocs\joomla1.5a\components\com_chronocontact\chronocontact.html.php(320) : eval()'d code on line 6

    This is a problem with line 6 of the Form HTML.
    <?
    function formIntro($name) {
      global $database;
     $keyref = "form.".$name;
      $sql = "SELECT introtext, id, title FROM jos_content WHERE attribs LIKE '%".$keyref."%' AND publish_up < now() ORDER BY id DESC";
      $database->setQuery( $sql );
    . . .
    Are you running in Legacy Mode? If not then global $database won't work, it needs to be
    $database =& JFactory::getDBO();


    The second failure is that you have a submit url of '/includes/iChing/form.php' - this means that the Form submits to this page and ChronoForms never sees the results so can't do anything with them. That's why Max put the big notice that says "dont put anything here unless you know what you are doing"!! :-)

    Bob
    DreamRaven 25 Nov, 2008
    I am running in legacy mode (thanks to AEC)...

    So it looks like the submit to URL that is throwing it out... I do need to have the content on that page shown, rather than the standard blank page (why no thank page text content option in the component?), so should I put it on the redirect page?

    Will the redirect page receive the data that is submitted?

    I will test your highlighted issues and report on my findings. All my other forms are copies of this one, or very similar, so it should solve my issues!

    Thanks
    GreyHead 25 Nov, 2008
    Hi Kieran,

    No the redirect page won't receive the data by default but you can build a url to send it as GET variables or use the CURL uption (search the forums) to send it as POST variables.

    There is a thank you page built into ChronForms - it's just blank by default. Any html in the OnSubmit boxes will be displayed after submission. So you could re-build your redirect page there.

    Bob
    DreamRaven 25 Nov, 2008
    Cool, thanks.

    Useful tips. I will go away and study some more to see what else I can do.

    Thanks again
    Keiran
    This topic is locked and no more replies can be posted.