Editing Existing Records

A common practice with database-driven Web sites is having a system in place so that you can easily edit existing records. This concept seems daunting to many beginning programmers, but it’s surprisingly straightforward. For the following example, editing registered user records, the process combines three skills you should already have:

  • Making sticky forms

  • Using hidden inputs

  • Registering new users

This next example is generally very similar to delete_user.php and will also be linked from the view_users.php script (when a person clicks Edit). A form will be displayed with the user’s current information, allowing for those values to be changed. Upon submitting the form, an UPDATE query will be run to update the database. ...

Get PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.