You are previewing PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition.
O'Reilly logo
PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition

Book Description

 It hasn't taken Web developers long to discover that when it comes to creating dynamic, database-driven Web sites, MySQL and PHP provide a winning open source combination. Add this book to the mix, and there's no limit to the powerful, interactive Web sites that users can create. With step-by-step instructions, complete scripts, and expert tips to guide readers, veteran author and database designer Larry Ullman gets right down to business: After grounding readers with separate discussions of first the scripting language (PHP) and then the database program (MySQL), he goes on  to cover security, sessions and cookies, and using additional Web tools,  with several sections devoted to creating sample applications. This guide is indispensable for Web designers who want to replace their static sites with something more dynamic. The companion Web site includes source code, support forums, and extra tutorials. In addition to being updated for the most recent releases of MySQL and PHP,  this new edition offers 25% new material, including updated examples for improved clarity and comprehension and new installation instructions for PHP, MySQL, and other related technologies. 

Table of Contents

  1. Copyright
  2. Special Thanks to
  3. Introduction
  4. About This Book
  5. Introduction to PHP
    1. Basic Syntax
    2. Sending Data to the Web Browser
    3. Understanding PHP, HTML, and White Space
    4. Writing Comments
    5. What Are Variables?
    6. About Strings
    7. About Numbers
    8. About Constants
    9. Single vs. Double Quotation Marks
  6. Programming with PHP
    1. Creating an HTML Form
    2. Handling an HTML Form
    3. Managing Magic Quotes
    4. Conditionals and Operators
    5. Validating Form Data
    6. What Are Arrays?
    7. For and While Loops
  7. Creating Dynamic Web Sites
    1. Including Multiple Files
    2. Handling HTML Forms with PHP Redux
    3. Making Sticky Forms
    4. Creating and Calling Your Own Functions
    5. Variable Scope
    6. Date and Time Functions
    7. Sending Email
  8. Introduction to SQL and MySQL
    1. Choosing Your Column Types
    2. Choosing Other Column Properties
    3. Using the mysql Client
    4. Creating Databases and Tables
    5. Inserting Records
    6. Selecting Data
    7. Using Conditionals
    8. Using LIKE and NOT LIKE
    9. Sorting Query Results
    10. Limiting Query Results
    11. Updating Data
    12. Deleting Data
    13. Using Functions
  9. Advanced SQL and MySQL
    1. Database Design
    2. Performing Joins
    3. Grouping Selected Results
    4. Creating Indexes
    5. Using Different Table Types
    6. Performing FULLTEXT Searches
    7. Database Optimization
  10. Error Handling and Debugging
    1. General Error Types and Debugging
    2. Displaying PHP Errors
    3. Adjusting Error Reporting in PHP
    4. Creating Custom Error Handlers
    5. Logging PHP Errors
    6. PHP Debugging Techniques
    7. SQL and MySQL Debugging Techniques
  11. Using PHP with MySQL
    1. Modifying the Template
    2. Connecting to MySQL and Selecting the Database
    3. Executing Simple Queries
    4. Retrieving Query Results
    5. Ensuring Secure SQL
    6. Counting Returned Records
    7. Updating Records with PHP
  12. Web Application Development
    1. Adjusting Behavior for Server Settings
    2. Sending Values to a Script Manually
    3. Using Hidden Form Inputs
    4. Editing Existing Records
    5. Paginating Query Results
    6. Making Sortable Displays
    7. Understanding HTTP Headers
  13. Cookies and Sessions
    1. Using Cookies
    2. Using Sessions
    3. Sessions and Cookies
    4. Improving Session Security
  14. Web Application Security
    1. More Secure Form Validation
    2. Handling HTML
    3. Validating Data by Type
    4. Form Validation with JavaScript
    5. Regular Expressions
    6. Database Security and Encryption
  15. Extended Topics
    1. Handling File Uploads
    2. PHP and JavaScript
    3. Using Output Buffering
    4. Using the Improved MySQL Extension
    5. New MySQL Features
    6. Using PEAR
  16. Example—Content Management
    1. Creating the Template
    2. Creating the Basic Pages
    3. Managing URLs
    4. Managing Files
  17. Example—User Registration
    1. Creating the Templates
    2. Writing the Configuration Scripts
    3. Creating the Home Page
    4. Registration
    5. Activating an Account
    6. Logging In and Logging Out
    7. Password Management
  18. Example—E-Commerce
    1. Creating the Database
    2. The Administrative Side
    3. Creating the Public Template
    4. The Product Catalog
    5. The Shopping Cart
    6. Recording the Orders
  19. Installation
    1. Installation on Windows
    2. Installation on Mac OS X
    3. MySQL Permissions
    4. Testing Your Installation
    5. Configuring PHP
  20. Reference
    1. PHP
    2. MySQL
  21. Resources
    1. PHP
    2. MySQL
    3. SQL
    4. Security
    5. Other Resources