|
|
 |
|
MySQL & PHP Manual - Build your own database driven web site!
|
Finally, a practical, down-to-earth guide to learning PHP & MySQL!
We hope you enjoy this sample chapter from "Build Your Own Database Driven Website Using PHP & MySQL" This book is only available from the SitePoint Website for US$34.95. It also comes with electronic access to all PHP and MySQL code samples used throughout the book.
Page - 1 - 2 - 3 - 4 - 5 - 6
You are on page 5
Click here for previous page... A Challenge
As homework, see if you can figure out how to put a link labeled "Delete this Joke" next to each joke on the page that, when clicked, will remove that joke from the database and display the updated joke list. Here are a few hints to get you started:
-
You'll still be able to do it all in a single multi-purpose page.
-
You'll need to use the SQL DELETE command, which we learned about in Chapter 2 (only in the full book).
-
This is the tough one. To delete a particular joke, you'll need to be able to uniquely identify it. The ID column in the Jokes table was designed to serve this purpose. You're going to have to pass the ID of the joke to be deleted with the request to delete a joke. The query string of the "Delete this Joke" link is a perfect place to put this value.
If you think you have the answer, or if you'd just like to see the solution, advance to the next page. Good luck! Summary
In this chapter, you learned some new PHP functions that allow you to interface with a MySQL database server. Using these functions, you built your first database-driven Web site which published the Jokes database online, and allowed visitors to add jokes of their own to it.
The remaining 7 chapters of Build your own Database Driven Website Using PHP & MySQL are available in my book.
The book explores several applications of your database in more depth. In Chapter 5, we'll go back to the MySQL command line. We'll learn how to use relational database principles and advanced SQL queries to represent more complex types of information, and give our visitors credit for the jokes they add.
Later chapters go on to build a complete content management system based on the humble beginnings we've just discussed. You'll learn how to build an ecommerce shopping cart, build a Web-based file repository, utilize sessions and cookies to track visitors, maintain database security and heaps more. To make the job of applying the applications to your Website extra-easy, I've also included a complete, downloadable code archive, which contains all the sample PHP & MySQL code that you'll use with the book.
If you're serious about taking PHP & MySQL to the next level, I'd encourage you to grab yourself a copy of "Build your own Database Driven Website Using PHP & MySQL". It's reasonably priced at only $34.95 (plus $9.95 shipping to anywhere in the World) and if you're not 100% satisfied with your purchase, SitePoint are more than happy to refund the purchase price of the book.
Okay Kevin, take me to the book information page. I want a copy now!
or read on for the "homework" solution"... Page - 1 - 2 - 3 - 4 - 5 - 6
|
 |
|