Prefilling customized form

noscrodamus wrote on Thursday, April 28, 2016:

I am trying to pre-fill an xmlformgenerated custom form, but am unable to populate. The function is question is: generate_form_field();

``

<?php echo xl_layout_label('Last Name','e').':'; ?><?php echo generate_form_field($manual_layouts['aofssb_lname'], $dataaa); ?>
$dataa = "SELECT * FROM `patient_data` WHERE `pid` = 6";
$sqquery = mysql_query($dataa);
$data1 = mysql_fetch_array($sqquery);
$dataaa= $data1['lname'];

I am trying to get the value from a field on another table, not the table the form created.
When entering in the $pid variable as the second paramter, I am successfully able to fill the form with the number ‘6’

noscrodamus wrote on Friday, April 29, 2016:

Update:

When assigning $dataaa to a string, I am able to populate the field. So I assume there must be something wrong with the sql query or the connection to the database.
Is the connection to the database always open or will i have to do a mysql_connect();?

Using: sqlQuery():
``
$dataaa = sqlQuery(“SELECT lname FROM patient_data WHERE pid = 6”);

``
still nothing populates in field.

fsgl wrote on Saturday, April 30, 2016:

If there are no other replies, would suggest Layout Based Visit Form or CAMOS for the clinical note, especially if if you need only 2-3 fields.

Building a form with XMLFormGen is less efficient than using the pre-built LBV, which requires no coding skills to modify. The only thing a user cannot do in a LBV form is draw.

Most of us don’t have time to doodle any more.