Book description
There are many reasons for serving up dynamic content from a web site: to offer an online shopping site, create customized information pages for users, or just manage a large volume of content through a database. Anyone with a modest knowledge of HTML and web site management can learn to create dynamic content through the PHP programming language and the MySQL database. This book gives you the background and tools to do the job safely and reliably.Web Database Applications with PHP and MySQL, Second Edition thoroughly reflects the needs of real-world applications. It goes into detail on such practical issues as validating input (do you know what a proper credit card number looks like?), logging in users, and using templatesto give your dynamic web pages a standard look.But this book goes even further. It shows how JavaScript and PHP can be used in tandem to make a user's experience faster and more pleasant. It shows the correct way to handle errors in user input so that a site looks professional. It introduces the vast collection of powerful tools available in the PEAR repository and shows how to use some of the most popular tools.Even while it serves as an introduction to new programmers, the book does not omit critical tasks that web sites require. For instance, every site that allows updates must handle the possibility of multiple users accessing data at the same time. This book explains how to solve the problem in detail with locking.Through a sophisticated sample application--Hugh and Dave's Wine Store--all the important techniques of dynamic content are introduced. Good design is emphasized, such as dividing logic from presentation. The book introduces PHP 5 and MySQL 4.1 features, while providing techniques that can be used on older versions of the software that are still in widespread use.This new edition has been redesigned around the rich offerings of PEAR. Several of these, including the Template package and the database-independent query API, are fully integrated into examples and thoroughly described in the text. Topics include:
- Installation and configuration of Apache, MySQL, and PHP on Unix®, Windows®, and Mac OS® X systems
- Introductions to PHP, SQL, and MySQL administration
- Session management, including the use of a custom database for improved efficiency
- User input validation, security, and authentication
- The PEAR repository, plus details on the use of PEAR DB and Template classes
- Production of PDF reports
Publisher resources
Table of contents
-
Web Database Applications with PHP and MySQL, 2nd Edition
- SPECIAL OFFER: Upgrade this ebook with O’Reilly
- A Note Regarding Supplemental Files
- Preface
- 1. Database Applications and the Web
-
2. The PHP Scripting Language
- 2.1. Introducing PHP
- 2.2. Conditions and Branches
- 2.3. Loops
- 2.4. Functions
- 2.5. Working with Types
- 2.6. User-Defined Functions
- 2.7. A Working Example
-
3. Arrays, Strings, and Advanced Data Manipulation in PHP
-
3.1. Arrays
- 3.1.1. Creating Arrays
- 3.1.2. Using foreach Loops with Arrays
-
3.1.3. Basic Array Functions
- 3.1.3.1. Counting elements in arrays
- 3.1.3.2. Functions that create arrays
- 3.1.3.3. Exploding and imploding strings
- 3.1.3.4. Finding the maximum and minimum values in an array
- 3.1.3.5. Finding values in arrays with in_array( ) and array_search( )
- 3.1.3.6. Keys and values
- 3.1.3.7. Joining two or more arrays
- 3.1.3.8. Reordering elements with array_reverse( )
- 3.1.4. Sorting Arrays
- 3.2. Strings
- 3.3. Regular Expressions
- 3.4. Dates and Times
- 3.5. Integers and Floats
-
3.1. Arrays
-
4. Introduction to Object-Oriented Programming with PHP 5
- 4.1. Classes and Objects
- 4.2. Inheritance
- 4.3. Throwing and Catching Exceptions
- 5. SQL and MySQL
-
6. Querying Web Databases
- 6.1. Querying a MySQL Database Using PHP
-
6.2. Processing User Input
- 6.2.1. Passing Data from the Browser to the Server
- 6.2.2. Passing Data with the HTML Form Environment
- 6.2.3. Passing Data with URLs
- 6.2.4. Passing Data with Embedded Links
- 6.2.5. More on Accessing User Data
- 6.2.6. Processing Form Data
- 6.2.7. Security and User Data
- 6.2.8. Querying with User Input
- 6.2.9. One-Component Querying
- 6.3. MySQL Function Reference
-
7. PEAR
- 7.1. Overview
- 7.2. Core Components
-
7.3. Packages
- 7.3.1. Installing, Upgrading, and Understanding Packages
- 7.3.2. Using HTML Templates
-
7.3.3. Optional Packages
- 7.3.3.1. Authentication
- 7.3.3.2. Benchmarking
- 7.3.3.3. Caching
- 7.3.3.4. Console
- 7.3.3.5. Database
- 7.3.3.6. Date
- 7.3.3.7. Filesystem
- 7.3.3.8. HTML
- 7.3.3.9. HTTP
- 7.3.3.10. Internationalization
- 7.3.3.11. Logging
- 7.3.3.12. Mail
- 7.3.3.13. Networking
- 7.3.3.14. PEAR
- 7.3.3.15. PHP
- 7.3.3.16. XML
- 7.3.3.17. Web services
- 8. Writing to Web Databases
-
9. Validation with PHP and JavaScript
- 9.1. Validation and Error Reporting Principles
- 9.2. Server-Side Validation with PHP
- 9.3. JavaScript and Client-Side Validation
-
10. Sessions
- 10.1. Introducing Session Management
- 10.2. PHP Session Management
- 10.3. Case Study: Using Sessions in Validation
- 10.4. When to Use Sessions
- 10.5. PHP Session API and Configuration
-
11. Authentication and Security
- 11.1. HTTP Authentication
- 11.2. HTTP Authentication with PHP
- 11.3. Form-Based Authentication
- 11.4. Protecting Data on the Web
- 12. Errors, Debugging, and Deployment
- 13. Reporting
- 14. Advanced Features of Object-Oriented Programming in PHP 5
-
15. Advanced SQL
- 15.1. Exploring with SHOW
- 15.2. Advanced Querying
- 15.3. Manipulating Data and Databases
- 15.4. Functions
- 15.5. Automating Querying
- 15.6. Table Types
- 15.7. Backup and Recovery
- 15.8. Managing Users and Privileges
- 15.9. Tuning MySQL
-
16. Hugh and Dave's Online Wines:A Case Study
- 16.1. Functional and System Requirements
- 16.2. Application Overview
- 16.3. Common Components
- 17. Managing Customers
- 18. The Shopping Cart
- 19. Ordering and Shipping at the Online Winestore
- 20. Searching and Authentication in the Online Winestore
- A. Linux Installation Guide
- B. Microsoft Windows Installation Guide
- C. Mac OS X Installation Guide
- D. Web Protocols
- E. Modeling and Designing Relational Databases
- F. Managing Sessions in theDatabase Tier
- G. Resources
- H. The Improved MySQL Library
- Index
- About the Authors
- Colophon
- SPECIAL OFFER: Upgrade this ebook with O’Reilly
Product information
- Title: Web Database Applications with PHP and MySQL, 2nd Edition
- Author(s):
- Release date: May 2004
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449396329
You might also like
book
Web Database Applications with PHP, and MySQL
What do eBay, Amazon.com and CNN.com have in common? They're all applications that integrate large databases …
book
PHP and MySQL Web Development, Third Edition
A new edition of this title is available, ISBN-10: 0672329166 ISBN-13: 9780672329166 We've taken the best …
book
PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Fifth Edition
Learn PHP and MySQL programming— the quick and easy way! Easy visual approach uses demonstrations and …
book
Effortless E-Commerce with PHP and MySQL, Second Edition
In this comprehensive guide to creating e-commerce website using PHP and MySQL, renowned author Larry Ullman …