Forums

Chronoforms 5 Retrive data from a database

formsj 13 Jan, 2014
Hello i am a new user with chronoforms nad till now i am impressed with all the futures. Well done 😀

Till now, i was able to create a simple form with 4 fields and save them inside a mysql database. I used Data Save function from designer view and it was effective.

Then i create a new form and tryed to retrive the same fields i saved before by using Data read. But it seems that does nothing. The Data Read function is on submit area but i have no idea what more i need. Maybe to add php code manually? Maybe it trully retrives the data but i am not able to view them? not sure.

All the exambles i was able to find was about Chronoforms 3 or version 4 nothing for the new one.

So, can we pls have a simple example of how to retrive and view data stored inside a database in Chronoforms 5?

Any help would be greatly appreciated.

Thank you for your time.
GreyHead 13 Jan, 2014
Hi Formsj,

How do you know it isn't working?

I think that if you add a Debugger action you should see the loaded data in the $form->data['Data'] array.

Bob
formsj 14 Jan, 2014
Well thank you for your quick reply.

I think you are right!

The form works perfectly. With the Read Function actually it retrives all (4) entrys.
I added a debbuger and was able to confirm that.

Array
(
    [chronoform] => Read
    [event] => submit
    [text1] => 
    [text2] => 
    [text3] => 
    [button4] => Submit
    [0] => Array
        (
            [Data] => Array
                (
                    [eponumo] => καρύδης
                    [onoma] => νικόλαος
                    [onomapat] => δημήτριος
                    [file] => 
                    [grafeio] => 1
                    [created] => 2014-01-13 12:39:43
                )

        )

    [1] => Array
        (
            [Data] => Array
                (
                    [eponumo] => 
                    [onoma] => 
                    [onomapat] => 
                    [file] => 
                    [grafeio] => 
                    [created] => 2014-01-13 12:42:32
                )

        )

    [2] => Array
        (
            [Data] => Array
                (
                    [eponumo] => 
                    [onoma] => 
                    [onomapat] => 
                    [file] => 
                    [grafeio] => 
                    [created] => 2014-01-14 06:29:05
                )

        )

    [3] => Array
        (
            [Data] => Array
                (
                    [eponumo] => jkkjfddsf
                    [onoma] => jkdskjdfjk
                    [onomapat] => kdjdkjdf
                    [file] => 
                    [grafeio] => 0
                    [created] => 2014-01-14 06:31:21
                )

        )

)

Now the next logical question is:
1) how i can diplay the array data
2) how i can SEARCH the database with spesific creteria for examble search for last name and display the resul.

Sorry for my begginer question but its my first time with databases and chronoforms🙂

Thanks again for your time.
wnedoe 07 Feb, 2014
To search for a specific record use the following Sysntax in teh conditions field:

<?php return array('id' => '17'); ?>

this performy an SQL query " ....... where id =17"


But that is not the solution you are looking for.
You are looking for a component to show your db entries: (liek me)

Theoreticalla Chronoconnectivity should be able to do this - I do have a license and did install it but as there is no documentation on it -and it is not intuitive at all - I decided to look for something else.
and I found something:
JooDatabase does exactly this. A free component.
Works well- is easy to understand -very intuitive - produces pretty output and is documented and free.
took me 1/10th of the time to unserstand compared to CF and I did some php and SQL in the past.

So you can use CF5 for inserting the records into the db and JooDatabase for displaying them.

MfG
Alexander Dobernig
This topic is locked and no more replies can be posted.