List data from a database table

display database records in a table format using ChronoForms.

Overview

The issue is a lack of knowledge on how to properly format and separate data fields from a database query into individual rows.
Use a DB read action to fetch the data, then in a Custom Code action, loop through the results and output each record's fields within HTML table row tags to organize them.

Answered
sa santosh.karkhanis 07 Jan, 2016
I wish to display data (number of records) from a database.
Is it possible using Chronoform?
How to use 'Custom Code' for the same?
ca calculus00 07 Jan, 2016
Fl FloB 08 Jan, 2016
Answer
Hi,

If you just want to display some data, you should use ChronoConnectivity instead of Chronoforms.

If you need ChronoForms, then you will have something like that:
On load event : DB read action (or equivalent to find the data) (Model id = my_data) + show html
On your form : custom code
<?php
foreach($form->data['my_data'] as $v){
$text=$text.$v['cell_1'].$v['cell_2'];
}
echo $text;
?>

You could format your data as you want (text, table...).

Hope this answer your question.
Florence
sa santosh.karkhanis 08 Jan, 2016
Great Florence, it works.
But I need a little more help, as I am not a coder by profession.
I am developing a site for my school in low income-group area.

Can you guide me on how to separate the different fields & arrange each record in a different row?

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