How to get Read Data results in PHP

Display read data results in PHP with ChronoForms.

Overview

The issue arises when trying to access and display data from a CF read data action within PHP, particularly to handle null values that affect layout.
To retrieve the data, use the provided method within your PHP code. For conditional display, you can check the value directly in your HTML by enabling PHP execution through the form's behaviors.

Answered
ChronoForms v8
CD CDLMQSE 09 Nov, 2025

Hi,

I'd like to display data from a `read data` action using a PHP action, mainly because some of the values ​​are null and this changes the layout. I'm new to Chronoforms 8 and would appreciate some help with the method and syntax.

Thanks

Max_admin Max_admin 09 Nov, 2025
Answer

Hi

For this specific issue you can use the COALESCE function in the Fields behavior:

How to get Read Data results in PHP image 1

this will return "Anonymous" when the name column has NULL

if you want to process this with PHP then you can get the read value(s) using:

$this->get("read_data19")

if you "return" value from the PHP action then they will be available under {var:php_name}

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
CD CDLMQSE 11 Nov, 2025

Hi,

Let me clarify my request. Previously, in ChronoConnectivity 5, I displayed custom code like this in a front-end view action:

<h3 style="border-bottom:1px solid #ccc;border-top:3px solid #ccc;">{illustres.prenom} {illustres.patronyme}
<?php if (isset($row['illustres']['alias']) && $row['illustres']['alias']!="") {
echo "dit ".$row['illustres']['prenom_pub']." ".$row['illustres']['alias'];
} ?></h3>

"illustres" was the name of the list.

How can I replicate this in Chronoforms 8?

si simelas 11 Nov, 2025
1 Likes

Hi CDLMQSE

assuming your table  "reads" from read_data15  you do not need ['illustres'] . Also PHP8 structure is a little bit different.

<h3 style="border-bottom:1px solid #ccc;border-top:3px solid #ccc;">{var:row.portrait} {var:row.patronyme}

<!-- you can use one of the two php herebelow -->

<?php  if ($this->get("row.alias") && $this->get("row.alias") !="")  {; ?>

<!--  or -->

<?php  if isset($this->get("row.alias")) && $this->get("row.alias") !="")  {; ?>

dit  {var:row.prenom_pub}    {var:row.alias}

?php  }  ?>

</h3>

also you do not need php19 .  simply activate php in your HTML  using Behaviors => run PHP

Max_admin Max_admin 11 Nov, 2025

Hi CDLMQSE

As simelas noted, the syntax inside the Table is {var:row.column_alias}

So from my example above you could use {var:row.name} to print that column

if you need to get that in PHP then:

$this->get("row.name")
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply