I created a new field in collect_info.php that calls a bunch of checkboxes based on a new table in my database. (Also created a new column for the information in the PRODUCT table.)
The checkboxes and labels are visible when both adding and editing a product. When I choose a checkbox and proceed to preview the product, I can see the checkbox option chosen on the previous page in the hidden fields.
My problem is that when I submit the form, it adds everything except my new field into the database. If anyone would be so kind, I need help in understanding why I can see the hidden field in the form, but it doesn't get added to the database.
Thank you in advance.
In case it will help, here is the code from collect_info.php
And from update_product.phpPHP Code:<?php
$tmp_checkbox = '';
while (!$metaphysical->EOF) {
$metaphysical_array[] = array('id' => $metaphysical->fields['metaphysical_id'],
'text' => $metaphysical->fields['metaphysical_material']);
$tmp_checkbox .= zen_draw_checkbox_field('metaphysical_id',$metaphysical->fields['metaphysical_id']) . $metaphysical->fields['metaphysical_material'] . "<br/>";
$metaphysical->MoveNext();
}
$options_name[] = $metaphysical->fields['metaphysical_material'];
$options_menu[] = $tmp_checkbox . "\n";
?>
<tr><td valign="top" class="main"><?php echo TEXT_PRODUCTS_METAPHYSICAL; ?></td>
<td class="main">
<?php for($i=0;$i<sizeof($options_name);$i++) {
echo $options_menu[$i]; } ?>
</td></tr>
and under "manufacturer_id" in update_info.phpPHP Code:<?php if (!empty($_POST['metaphysical_id'][$i])) {
$metaphysical_id = $_POST['metaphysical_id'];
$metaphysical_id_array = '';
foreach ($metaphysical_id as $value) {
$metaphysical_id_array .= $value . ',';
}
}
?>
PHP Code:<?php
'metaphysical_id' => zen_db_prepare_input($metaphysical_id_array),
?>


Reply With Quote
