Preface


PHP and MySQL are a powerful combination that together make it easy to create web applications. If you've been creating web pages but want to build more sophisticated sites that can grow and interact with users, PHP and MySQL let you build your foundations quickly, and subsequently build on them to meet your needs.

Our goal is to help you learn the ins and outs of PHP and MySQL and save you some of the "Why doesn't that work?" moments that we've already been through. We'll show you what to watch for and how to fix these issues without pulling out your hair.

Audience

This book is for people who want to know how to create dynamic web sites. That could include graphic designers who are already working in an IT firm or advertising firm creating static web sites, who may need to move forward with coding database-driven web sites. It might also include people who already know, say, Flash development and HTML markup, but need to expand their repertoire of skills to database and open source programming environments.

Assumptions This Book Makes

This book assumes you understand how web browsers work and have a basic understanding of HTML. Some understanding of JavaScript may be useful (for Chapter 15) but isn't generally required.

You might also be over-qualified. If you already know how to create pages using MySQL and PHP, then you'd probably be better off with a book that is more a reference than a Learning book, such as one from the Nutshell series.

Organization of This Book

This book starts out with an overview of how all of the pieces you'll be working with fit together. Because there are multiple languages and technologies that interact to form the dynamic web pages, it's best to start with a solid foundation of how the pieces work together. The PHP that you'll learn works as a sort of a total integration package for dynamic web sites.

Next, we'll walk through installing the core software packages on your local computer. This book focuses on PHP and MySQL, but making this work also usually requires the Apache web server. The PHP interpreter works with the web server when processing dynamic content. Finally, you'll install the MySQL database. Installation is covered on the PC, Mac, and Linux systems. You can also use a hosted ISP account to develop your pages, if you don't want to install everything locally.

Since PHP plays an important role in pulling everything together, we take the time to explain the basics of working with the PHP language. This includes language essentials such as data types, program flow logic, and variables. Functions, arrays, and forms each get their own chapter to fully explore them.

Since you may be new to databases in general, we ease into MySQL by first explaining concepts that apply to designing and using any relational database. Then we give specific examples of using MySQL to interact with your data. Once you can get data in and out of the database, you'll need to work with PHP to integrate that data into your dynamic content.

Security and access control to your web pages each get their own chapter. While security may sound like a dull subject, it's still a huge issue if you store any information that's private on your web page. There are several common security pitfalls that we'll guide you around.

Finally, we close with sample applications that demonstrate how the technologies work together to rapidly build workable, fast web sites. You'll also learn where to look for additional information on the topics covered in the book.

Supporting Books

Even if you feel you are ready for this book, you may want to explore some of the XML technologies in greater depth than is possible here. The following list offers some good places to start:

  • Run Your Own Web Server Using Linux & Apache, by Tony Steidler-Dennison (SitePoint, 2005).

  • PHP in a Nutshell, First Edition, by Paul Hudson (O'Reilly, 2005).

  • MySQL in a Nutshell, First Edition, by Russell Dyer (O'Reilly, 2005).

  • CSS Cookbook, First Edition, by Christopher Schmitt (O'Reilly, 2004).

There are also several good online resources for dynamic web development, including onlamp.com, part of the O'Reilly Network. LAMP stands for Linux, Apache, MySQL, PHP. LAMP is the de facto standard for serving dynamic web pages.

Conventions Used in This Book

The following font conventions are used in this book:


Italic

Indicates pathnames, filenames, and program names; Internet addresses, such as domain names and URLs; and new items where they are defined


Constant width

Indicates command lines and options that should be typed verbatim; names and keywords in programs, including method names, variable names, and class names; and HTML element tags


Constant width bold

Indicates emphasis in program code lines


Constant width italic

Indicates text that should be replaced with user-supplied values

This icon signifies a tip, suggestion, or general note.


This icon indicates a warning or caution.


Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you're reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O'Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product's documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: "Learning PHP and MySQL by Michele E. Davis and Jon A. Phillips. Copyright 2006 O'Reilly Media, Inc., 0-596-10110-4."

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at permissions@oreilly.com.

Safari® Enabled

When you see a Safari® Enabled icon on the cover of your favorite technology book, that means the book is available online through the O'Reilly Network Safari Bookshelf.

Safari offers a solution that's better than e-books. It's a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you need the most accurate, current information. Try it for free at http://safari.oreilly.com.

How to Contact Us

We have tested and verified the information in this book to the best of our ability, but you may find that features have changed (or even that we have made a few mistakes!) Please let us know about any errors you find, as well as your suggestions for future editions, by writing to:

O'Reilly Media, Inc.

1005 Gravenstein Highway North

Sebastopol, CA 95472

800-998-9938 (in the U.S. or Canada)

707-829-0515 (international/local)

707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://www.oreilly.com/catalog/learnphpmysql/

To comment or ask technical questions about this book, send email to:

bookquestions@oreilly.com

For more information about our books, conferences, Resource Centers, and the O'Reilly Network, see our web site at:

http://www.oreilly.com

Acknowledgments

First, we'd like to thank our wonderful agent, Matt Wagner of Fresh Books, for bringing such a fabulous opportunity to the table for us. The opportunity to write for O'Reilly Media was a great honor. As technologists, our bookcase is already well populated with animals from the Nutshell series.

Thanks to our O'Reilly developmental editors, Brett McLaughlin and Simon St.Laurent. This book wouldn't be what it is without both of their help working with us. Second, profuse thanks to our technical editors, especially Jereme Allen and Christopher Finke, whom we met through our local Minneapolis/St. Paul PHP community: http://www.tcphp.org. Technical edit thanks also go to our last technical editor, Patrick Krekelberg.



Learning PHP and MySQL
Learning PHP and MySQL
ISBN: 0596101104
EAN: 2147483647
Year: N/A
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net