Chapter 11. Listing, Iterating, and Administrating
For quite a while now, youâve been focusing on some basic details: a user, the userâs information, and as an extension of that information, the userâs profile picture. Youâve become familiar with PHP and MySQL, figured out not just one but two ways to deal with one of the most common PHP issuesâimage loadingâand youâve managed to keep things looking good throughout. These arenât small accomplishments; theyâre very much big ones.
As a user, you can set up a profile and specify some basic information. If youâre an administrator, you might want to see how many users are in your system, delete a malicious user, or update a picture because itâs not quite socially palatable. You can do all that through your MySQL command line, but in the real world of web applications, most administrators arenât keeping a MySQL terminal running in the corner of their monitor.
Instead, they have administrative interfaces. They can list all the users in a system; check some boxes here and there and mass delete users; and see any user they want, all through a nice, clean web interface. You can give your web application the same nice features.
When you start thinking about an administrative interface, you run into all sorts of interesting problems. You need to use different types of SQL queries. You have to mix together a lot more PHP and MySQL with your HTML because youâll have to list every user from the database, one at a time. ...
Get PHP & MySQL: The Missing Manual, 2nd 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.