Hi,
I have inserted data into my database using ChronoForm V5. Now i want to display the data.
In the tab Models i have created a model name / i have indicated the DB table name and in condition i have entered
<?php return array('my_model_name.my_field' => '17'); ?> (because i want the raw where mu_field = 17 ...)
In fiels / order i have indicated what fiels i need from the table
In the Front list tab, if I choose TABLE and in column list i write
my_model.my_field1:my_field1
...
my_model.my_fieldn:my_fieldn
the result is the display of the data but not arrange like i need
To try to modify the display, in display type i have selected Custom
then in List display,
- in header box i have entered HTML code to diplay the header tab
- in footer box i have entered HTML code to diplay the footer tab
My concern is what to enter into the body box in the middle of the HTML code to display the values extracted from the database ???
I have tested
- <?php echo my_model.myfield; ?>
- <?php echo {my_field}; ?>
- <?php echo $row[my_model][my_field] ?>
- <?php echo $form->data['my_field'] ?>
And nothing is diplaying results, I'm totally lost
I have inserted data into my database using ChronoForm V5. Now i want to display the data.
In the tab Models i have created a model name / i have indicated the DB table name and in condition i have entered
<?php return array('my_model_name.my_field' => '17'); ?> (because i want the raw where mu_field = 17 ...)
In fiels / order i have indicated what fiels i need from the table
In the Front list tab, if I choose TABLE and in column list i write
my_model.my_field1:my_field1
...
my_model.my_fieldn:my_fieldn
the result is the display of the data but not arrange like i need
To try to modify the display, in display type i have selected Custom
then in List display,
- in header box i have entered HTML code to diplay the header tab
- in footer box i have entered HTML code to diplay the footer tab
My concern is what to enter into the body box in the middle of the HTML code to display the values extracted from the database ???
I have tested
- <?php echo my_model.myfield; ?>
- <?php echo {my_field}; ?>
- <?php echo $row[my_model][my_field] ?>
- <?php echo $form->data['my_field'] ?>
And nothing is diplaying results, I'm totally lost
Hi ledev,
You need to add the HTML to create a table row like this
Bob
You need to add the HTML to create a table row like this
<tr>
<td style='width: 50px;' >{content.title}</td>
<td>{content.image}</td>
<td>{content.input}</td>
</tr>
- this is from a test listing of mine, you will have different values.
Bob
Hi
thanks for the answer. Not sure what you mean by {content.title} / {content.image} / {content.input}
What are "content" / "title" for you ?
I have tested with {my_model.myfield} with my_model = name of the model in the model tab / myfield = name of the field in the database.
I have tested {my_model.myfield} in HTML and <?php echo {my_model.myfield}; ?> and nothing OK...
Any idea
thanks for the answer. Not sure what you mean by {content.title} / {content.image} / {content.input}
What are "content" / "title" for you ?
I have tested with {my_model.myfield} with my_model = name of the model in the model tab / myfield = name of the field in the database.
I have tested {my_model.myfield} in HTML and <?php echo {my_model.myfield}; ?> and nothing OK...
Any idea
Hi Again Bob,
The last message allow me to display the needed data, cool, but ...
the data on the DB as store like that (I have verified with PHPMyAdmin):
And it displayed like that wothout keeping the database text formating...
test1 line1_text line2_text test2 line3_text line4 text
I have tried to display it in HTML
or in PHP, tried to format it with str_replace and nl2br and still same result, test is displayed with formating
and last but not least, just to bore me, if I test that code, the display is fine
The last message allow me to display the needed data, cool, but ...
the data on the DB as store like that (I have verified with PHPMyAdmin):
test1
line1_text
line2_text
test2
line3_text
line4 text
And it displayed like that wothout keeping the database text formating...
test1 line1_text line2_text test2 line3_text line4 text
I have tried to display it in HTML
<br /><br />
{test_1_db_access_bru.Texte_complet}
<br /><br />
or in PHP, tried to format it with str_replace and nl2br and still same result, test is displayed with formating
<?php
$toto = '{test_1_db_access_bru.Texte_complet}';
//$text=str_replace("\n", "<br>", '{test_1_db_access_bru.Texte_complet}');
//$text=nl2br($toto);
$text=str_replace('\n', '<br />', '{test_1_db_access_bru.Texte_complet}');
echo $text;
?>
and last but not least, just to bore me, if I test that code, the display is fine
<textarea>".'{test_1_db_access_bru.Texte_complet}'."</textarea>
Hi Again Bob same text but formated,
The last message allow me to display the needed data, cool, but ... the data on the DB as store like that (I have verified with PHPMyAdmin):
And it displayed like that wothout keeping the database text formating...
I have tried to display it in HTML
Or in PHP, tried to format it with str_replace and nl2br and still same result, test is displayed with formating
And last but not list, just to bore me, if I test that code, the display is fine
The last message allow me to display the needed data, cool, but ... the data on the DB as store like that (I have verified with PHPMyAdmin):
test1
line1_text
line2_text
test2
line3_text
line4 text
And it displayed like that wothout keeping the database text formating...
test1 line1_text line2_text test2 line3_text line4 text
I have tried to display it in HTML
<br /><br />
{test_1_db_access_bru.Texte_complet}
<br /><br />
Or in PHP, tried to format it with str_replace and nl2br and still same result, test is displayed with formating
<?php
$toto = '{test_1_db_access_bru.Texte_complet}';
//$text=str_replace("\n", "<br>", '{test_1_db_access_bru.Texte_complet}');
//$text=nl2br($toto);
$text=str_replace('\n', '<br />', '{test_1_db_access_bru.Texte_complet}');
echo $text;
?>
And last but not list, just to bore me, if I test that code, the display is fine
<textarea>".'{test_1_db_access_bru.Texte_complet}'."</textarea>
Hi ledev,
You can't use the {model_id.name} syntax in PHP :-( Please try this:
Bob
You can't use the {model_id.name} syntax in PHP :-( Please try this:
<?php
$text=str_replace("\n", '<br />', $form->data['test_1_db_access_bru']['Texte_complet']);
echo $text;
?>
Bob
This topic is locked and no more replies can be posted.