I would like to use the same form for adding new records and editing
existing records. New form values are contained in $_POST. Database values
are contained in an associated array. It seems to me that in order to use
the same form for both tasks, I need to assign the form field values to page
variables. The flow might look something like this:
if $_POST
$variable1 = $_POST['field1'];
$variable2 = $_POST['field2'];
else if $rows
$variable1 = $row['field1'];
$variable2 = $row['field2'];
end if
Can someone suggest a simplier way to do this?
existing records. New form values are contained in $_POST. Database values
are contained in an associated array. It seems to me that in order to use
the same form for both tasks, I need to assign the form field values to page
variables. The flow might look something like this:
if $_POST
$variable1 = $_POST['field1'];
$variable2 = $_POST['field2'];
else if $rows
$variable1 = $row['field1'];
$variable2 = $row['field2'];
end if
Can someone suggest a simplier way to do this?
Comment