Hi all,
I have a form that is being generated by a column and row selection.. kind of like excel. I am trying to fill out the form with mysql data that is stored when the form was first generated. Since the form is dynamically generated, I can't specifiy the exact column header in the mysql database.. The php below is what I am working on to try to do that but it doesnt seem to be working.. Anyone have any ideas?
//mysql query for the data.. this works fine..
$tmpquery1 = "WHERE custom_table.id = '$id'";
$CustomDetail = new request();
$CustomDetail->opencustom_table($tmpquery1);
//Loop to generate text boxes on the form and hopefully fill those boxes with the mysql data. (normally I would specify the column header directly and it would pull it that way.. but in this instance that wont work. that would normally be: $table_head= $CustomDetail->custom_table_header_top1[0]; echo $table_head; the header_top1 would change to header_top2 or 3 or whatever. but since it must be dynamic, it must be like something below.
for($j = 0; $j < $columns2; $j++) {
$table_head = "custom_table_header_top$j"."[$j]";
$header_top12 = $CustomDetail->$table_head;
echo "<td><textarea name='header_top' cols='10' rows='3'>$header_top12</textarea></td>";
}