3537-4 FM...

Jak cię złapią, to znaczy, że oszukiwałeś. Jak nie, to znaczy, że posłużyłeś się odpowiednią taktyką.
f.qc 12/15/00 15:31 Page vii
In memory of Dr. Jonathan B. Postel
3537-4 FM.f.qc 12/15/00 15:31 Page ix
Preface Welcome. If you are thumbing through these pages, you’re probably considering writing Web-based applications with PHP and MySQL. If you decide to go with these tools, you’ll be in excellent company. Thousands of developers — from total newbies to programmers with years of experience — are turning to PHP and MySQL
for their Web-based projects; and for good reason.
Both PHP and MySQL are easy to use, fast, free, and powerful. If you want to get a dynamic Web site up quickly, there are no better choices. The PHP scripting language was built for the Web. All the tasks common to Web development can be accomplished in PHP with an absolute minimum of effort. Similarly, MySQL excels at tasks common to dynamic Web sites. Whether you’re creating a content-management system or an e-commerce application, MySQL is a great choice for your data storage.
Is This Book for You?
There are quite a few books that deal with PHP and a few that cover MySQL. We’ve read some of these and found a few to be quite helpful. If you’re looking for a book that deals with gory details of either of these packages, you should probably look elsewhere.
The focus of this book is applications development. We are concerned with what it takes to get data-driven Web sites up and running in an organized and efficient way. The book does not go into arcane detail of every aspect of either of these tools.
For example, in this book, you will not find a discussion of PHP’s LDAP functions or MySQL’s C application program interface (API). Instead, we will focus on the pieces of both packages that affect one another. We hope that by the time you’re done with this book you’ll know what it takes to get an application up and running using PHP and MySQL.
How This Book Is Organized
We have organized the book into four parts.
Part I: Using MySQL Before you code any PHP scripts, you will need to know how to design a database, create tables in your database, and get the information you want from the database.
Part I of this book will show you about all you need to know to work with MySQL.
ix
3537-4 FM.f.qc 12/15/00 15:31 Page x
x
Preface
Part II: Using PHP As an applications developer, the bulk of your time will be spent writing scripts that access the database and present HTML to a user’s browser. Part II will start by showing you the basics of the PHP scripting language, covering how PHP works with variables, conditions, and control structures. Part II will also cover many of PHP’s functions and discuss techniques for writing clean, manageable code.
Part III: Simple Applications In this part, we present two of the seven applications in this book: a guestbook and a survey. Here you will see the lessons from Parts I and II put into practice as we build working applications.
Part IV: Not So Simple Applications Here the applications will be more complex, as we present applications commonly used on the Web. You will see how you can design a content management system, a discussion board, a shopping cart, and other useful applications. Along the way, we will show some tips and techniques that should be helpful as you write your applications.
Part V: Appendixes The appendixes cover several topics of interest to the MySQL/PHP developer. In the appendixes, you will find installation and configuration instructions, quick reference guides to PHP and MySQL functions, a regular expressions overview, and guides to MySQL administration. In addition, there are a few helpful resources, snippets of code, and instructions on using the CD-ROM.
Tell Us What You Think
Both the publisher and authors of this book hope you find it a valuable resource.
Please feel free to register this book at the IDG Books Web site (http://www.
idgbooks.com) and give us your feedback. Also check in at the site we’ve dedicated to this book, http://www.mysqlphpapps.com/, where you will be able to contact the authors and find updates to the applications created for this book.
3537-4 FM.f.qc 12/15/00 15:31 Page xi
Acknowledgments
This book would never have happened if not for the efforts of Debra Williams Cauley. I thank her for her patience and persistence. The efforts and talents of Neil Romanosky, S. B. Kleinman, and many others at IDG Books have made this book more lucid and attractive than we could have hoped. Richard Lynch’s exacting eye and technical acumen kept our code clean, fast, and readable.
Any book on open-source software owes debt to those who have created these great tools. So I thank everyone involved with PHP and MySQL, from the core developers to those who contribute to the documentation. Special thanks to Michael (Monty) Widenius, MySQL’s lead developer. He has not only created a terrific relational database, but has offered his advice and expertise to the authors of this book.
xi
3537-4 FM.f.qc 12/15/00 15:31 Page xii
Contents at a Glance
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . xi Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii Part I
Working with MySQL
Chapter 1 Database Design with MySQL . . . . . . . . . . . . . . . . . 3
Chapter 2 The Structured Query Language for Creating and
Altering Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Chapter 3 Getting What You Want with select . . . . . . . . . . . . 45
Wątki
Powered by wordpress | Theme: simpletex | © Jak cię złapią, to znaczy, że oszukiwałeś. Jak nie, to znaczy, że posłużyłeś się odpowiednią taktyką.