Forums

Problem reading fields from database

jmeidal 23 Feb, 2016
I have a simple form from which I'm trying to test Data Read.

I have the debugger on here, which is very helpful.
https://www.theoakscamp.org/index.php?option=com_chronoforms5&chronoform=SS_App_Viewer&id=1

My conditions are:
<?php
return array('id' => $form->data['id']);
?>

* I've matched my field names to the original form and database field names.
* Currently I can only get it to load my database array by adding a id=value on the URL.
* I'm just not what I'm missing to get the rest of the fields to populate. Do I need to add conditions for all of them?
* I see there is an empty array error, but not sure what to do with this...

THANKS!
GreyHead 24 Feb, 2016
Hi jmeidal,

In the DB Read action please set Enable Model ID to No - that should solve the problem.

The Model ID lets you separate the read data into a sub-array as you can see from the Debugger output. That can sometimes be useful but requires that you use array names for the inputs.

Bob
jmeidal 24 Feb, 2016
This helped it, I have it working now! Thanks.

HOWEVER, I'm wanting to extract a long list of fields, do I have to input them all separated by commas? It seems "*" will not work, right?
GreyHead 24 Feb, 2016
Hi jmeidal,

If you leave the Fields box empty then they will all be loaded if I remember correctly.

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