Forum Moderators: open
I have some queries related to mysql.
1. Moving to first record / last record in a table on a php webform.
2.I want to update a mysql tablerow by checking the value of the primary key in the table with a text value on the form. The trouble is how do I refer to the "database field" from within the webform.
Thanks in advance.
<input type="hidden" name="my_process" value="add_record">
........
sub add_record {
insert into table (values);
....
select id from table order by id desc limit 1;
# Then set the variable for "id" as this record
$var{'rec_id'} = $id;
# Now set the process to EDIT MODE and return to the form
$var{'process'} = 'update_record';
}
So when the form reloads, it is now in edit mode:
<input type="hidden" name="my_process" value="update_record">
<input type="hidden" name="rec_id" value="$var{'rec_id'}">