Thanks for the help. I'm not sure exactly how to do everything you said, here is what I have so far. I know I'm making some mistakes I just don't know where. I'm still learning.
PHP Code:
// Handle the update
if (isset($_POST['submitted'])) {
unset($_POST['TableData_length']);
unset($_POST['update-fields']);
unset($_POST['submitted']);
foreach ($_POST AS $k => $v) {
// Remove the child_id from the form name
$keys = explode('-', $k);
$child_id = end($keys);
$field_name = $keys[0];
$posted[$child_id] = array('child_id' => $child_id, 'field' => $field_name, 'value' => $v);
}
foreach($posted AS $post) {
$qpost = "UPDATE children SET ";
foreach ($post AS $id) {
$qpost .= "{$id['field']} = '{$id['value']}, ";
}
$qpost = substr($qpost, 0, -2); // take off the last comma and space
$qpost .= " WHERE child_id = '{$post['child_id']}";
echo $qpost;
}
}
I get this error: /child_bulk.php' on line 33: Uninitialized string offset:
this is line 33
PHP Code:
$qpost .= "{$id['field']} = '{$id['value']}, ";
Bookmarks