PHP and MySQL Web Development - P120: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | Implementation 567 Next to each headline a link is generated in the following form a href page 1 font size 1 Read more news. font a This is done within the previous loop so that the query string value of page and the page name are printed next to the relevant headline. Clicking this link takes the visitor to the full list of stories for the particular page. The source for can be found in Listing . Listing Displays All the Published Stories on a Page php if isset HTTP_GET_VARS page header Location exit page HTTP_GET_VARS page include include conn db_connect sql select from stories where page page and published is not null order by published desc result mysql_query sql conn while story mysql_fetch_array result print h2 . story headline . h2 if story picture size getImageSize story picture width size 0 height size 1 print img src . story picture . height height width width align left print story story_text w get_writer_record story writer print br font size 1 print w full_name . print date M d H i story modified 568 Chapter 26 Building a Content Management System Listing Continued print font include Note that requires a value for page to formulate the first query correctly. In case is ever called directly without the query string the first condition if isset HTTP_GET_VARS page header Location exit will send the visitor back to the headline page so that the omission of page will not cause an error. The first query select from stories where page page and published is not null order by published desc finds all stories published on the specified page with the most recently published first. Within each loop the uploaded image and story text are printed to the screen followed by the writer s name and date of last change. Figure shows in action displaying all the news page items for our sample application. Back End Let s look .