CREATING A DYNAMIC ONLINE GALLERY Figure 12-5. The

CREATING A DYNAMIC ONLINE GALLERY Figure 12-5. The page navigation system is now complete. Check your code, if necessary, against gallery_mysql08.php, gallery_mysqli08.php, or gallery_pdo08.php. Summary Wow! In a few pages, you have turned a boring list of filenames into a dynamic online gallery, complete with a page navigation system. All that s necessary is to create a thumb nail for each major image, upload both images to the appropriate folder, and add the file name and a caption to the images table in the database. As long as the database is kept up to date with the contents of the images and thumbs folders, you have a dynamic gallery. Not only that, you ve learned how to select subsets of records, link to related information through a query string, and build a page navigation system. The more you use PHP, the more you realize that the skill doesn t lie so much in remem bering how to use lots of obscure functions, but in working out the logic needed to get PHP to do what you want. It s a question of if this, do that; if something else, do something different. Once you can anticipate the likely eventualities of a situation, you can normally build the code to handle it. So far, you ve concentrated on extracting records from a simple database table. In the next chapter, I ll show you how to insert, update, and delete material. 339
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Leave a Reply