hello, am kind of new at php and i badly need assistance. i would to create a view where by some one can edit and delete whatever is in the database through the view. i have a page that lists the hostel name, location, email and contact address. i wanted it to be in such a way that if some one clicks on the hostel name it looks for the id of the hostel and lists details about that hostel and then from the view some one can then make deletions and modifications like updates.
Okay, you need to dynamically generate you're list of hostels from the DB. Each link should pass the hostel ID in the URL to a page where they can be edited.
eg. if you're page to edit the the data is edit.php you would want your links to point to edit.php?id=1 to edit the first hostel.
The edit.php page would need to get the id passed to it in the url (it would exist as $_GET['id']). Then you'd use that id to select all the information relating to that record from the DB.
Run a select query, and populate your form with the resultant data.
When the user submits that form you need to update the record with the new info.
To delete I'd probably have a seperate button on the form.
Its not especially complex, but there are a few different aspects to doing what you want.
I had written some code for you, but I accidentally hit backspace and the browser went back a page and I lost it all. I don't have the patience to write it again
Bookmarks