I've read the FAQ page at https://www.chronoengine.com/faqs/70-cfv5/5219-how-to-load-record-data-from-a-database-table-into-your-form.html.
But it doesn't cover much. It only covers setting up the DB Read event. I've set the table name, field, and conditions as explained in that article. My field name, 'cb_com_company', is identical to the dropdown field name in the 'design' area. But it doesn't mention what you should put in for the field 'options' (if anything), or anything about setting up the field.
The FAQ article didn't mention what kind of field, so maybe this is not possible for loading options into a dropdown field?
On the conditions, I first assumed these were database conditions and only wanted it to pull data from the field, 'cb_com_company' when the field in the column 'cb_accounttype' was equal to 'Company'. So I wrote it like:
<?php
return array('cb_accounttype' => 'Company');
?>
Then after reading the instructions on that FAQ page over and over, I decided maybe that was what told the event where to place the fields, so I re-wrote it to:
<?php
return array("cb_com_company" => form->data("cb_com_company"))
?>
The form field and the database field have the exact same name. But this doesn't make nearly as much sense to me as the way I wrote it first.
Any help with this would be appreciated. Or maybe the link to where it says, "For more examples and more advanced queries please check this FAQ", on that FAQ page I mentioned above (the link is broken).
Thanks!
But it doesn't cover much. It only covers setting up the DB Read event. I've set the table name, field, and conditions as explained in that article. My field name, 'cb_com_company', is identical to the dropdown field name in the 'design' area. But it doesn't mention what you should put in for the field 'options' (if anything), or anything about setting up the field.
The FAQ article didn't mention what kind of field, so maybe this is not possible for loading options into a dropdown field?
On the conditions, I first assumed these were database conditions and only wanted it to pull data from the field, 'cb_com_company' when the field in the column 'cb_accounttype' was equal to 'Company'. So I wrote it like:
<?php
return array('cb_accounttype' => 'Company');
?>
Then after reading the instructions on that FAQ page over and over, I decided maybe that was what told the event where to place the fields, so I re-wrote it to:
<?php
return array("cb_com_company" => form->data("cb_com_company"))
?>
The form field and the database field have the exact same name. But this doesn't make nearly as much sense to me as the way I wrote it first.
Any help with this would be appreciated. Or maybe the link to where it says, "For more examples and more advanced queries please check this FAQ", on that FAQ page I mentioned above (the link is broken).
Thanks!