PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a file called 'category.php' which display some of the categories from my database. Also have 'edit' button for each categories displaying.
On clicking the edit button, 'edit category.php' will be diplayed. The thing i need is, I want to bring the category names into the 'edit category.php' pages. so that i can edit and update the categories in to my database using these pages.
The coding for both these files are displayed here.
You need to modify the category.php code a bit; currently when going to a page there is no way to select a specific record: add something unique for each record to the query string
<?php
// add something unique to the url for edit category.php, maybe an id from the database
// or the category name
echo "<a href='edit category.php'><img src='images/edit.gif'/></a>";
?>
The sql query on the edit category page will also require editing to select only the record with the specific unique value. Also don't select everything (*) but select just the fields you need to use. The hidden field contains the unique value for the category which will be used when updating the category on submission.