First things first, you need to write simple algorithms/procedures for your desired tasks. From what i see the simple steps would be something like.
1. click add takes you to page for adding data
2. click update modifies your data
3. click delete will take you to page for deletion
4. click next, displays next record from recordset
5. click previous, displays previous record from recordset
So from the looks of things here, you will can do all these things one webpage, but for clarity we'll do it with 2 pages.
Page1.php will display the data in a single row, and will contain a form comprising of:
- textboxes, textareas, or ... depending on the data stored in the db.
- 4 buttons (Update, Next, Previous & Delete) at the bottom of the page
a) Update button(input of type submit) will just post the form to the the same page(Page1.php) and update the record and redisplay it.
b) Delete button(input of type button) will use the onclick event of the button to pass the record id via the url to the page responsible for deletion(also Page1.php). Code in the onclick event will be something like onclick="window.location='Page1.php?id=2&action=delete'" . This id in the url is set, whilst you filling up your form controls with data at the server, and is what you'll use to identify the record to be deleted.
c) & d)Previous & Next buttons (inputs of type button) will have similar code to that of the Delete button, except that the $_GET variables id and action have different values
- Previous button: <input type="button" name="previous" onclick="window.location='Page1.php?id=1&action=move'">
- Next button: <input type="button" name="next" onclick="window.location='Page1.php?id=2&action=move'">
Here, the id values are the ids of the record to display next.
NOTE: At the server when handling these navigation requests(Next & Previous) you must take care to check for the validity/existence of the next or previous record.
Page2.php will be responsible for the creation of the new data. Therefore it will just contain a form similar in structure to Page1.php but instead of updating, it will insert the data into the database. This page can also post data to itself, then after inserting the data, redirects to Page1.php.
That's the logic you can use to start of with.