LOAD DATABASE RECORD

load a database record using a value from a previous query in ChronoForms.

Overview

The issue was an incorrect variable path used to reference the retrieved school ID from the initial database read action.
Correct the variable path to include the model name. If only one record is returned, configure the data read action to return the first record only and use the proper syntax.

Answered
ChronoForms v6
at atanunu 20 May, 2017
Sir,

Please I need load a database record; using the schoolid retrieved from a previous DB READ action. I am having issues doing this kindly assist.


Data12.SCHMSschoolnumber:{var:read_data10.SCHUAschoolid}
Data12.SCHMSRemark:1
Max_admin Max_admin 20 May, 2017
1 Likes
Hi atanunu,

As per the debug, the value is under this path:
{var:read_data10.0.Data10.SCHUAschoolid}


If you are using only 1 result then set the "data read" to return the first record only and use this:
{var:read_data10.Data10.SCHUAschoolid}


The model name must be included.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
at atanunu 20 May, 2017
Thanks Sir,

it worked perfectly, but how can I pass it as form data using the code below
<?php 
$this->data['Perfect'] = $this->data['Data10']['SCHUAschoolid'];
?>
Gr GreyHead 20 May, 2017
Hi atanunu ,

There are several ways, one is to add a hidden input to your form with the name=Perfect

You could also look up this information after the form submits if you don't need to display it.

Bob
at atanunu 20 May, 2017
Thanks Sir,

I had tried different ways to look up the information; as I need to turn it to form data {data:} with out displaying or revealing it in anyway.

Kindly assist further.
Max_admin Max_admin 20 May, 2017
Answer
1 Likes
Hi atanunu,

Why do you want to put the info in the form data ?

You can use this in a PHP function:

$this->data['perfect'] = $this->get("read_data10.0.Data10.SCHUAschoolid");

but its really unnecessary as the value can be retrieved by the syntax I posted before.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
at atanunu 20 May, 2017
Thanks Sir,

I had used this format in CF V5 form, i am migrating to CF V6 and CC V6 and want to maintain the same procedure as I am not yet good on the new versions.

It worked perfectly. Thanks a lot for your support
This topic is locked and no more replies can be posted.