O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PHP and MySQL Web Development: A Beginner’s Guide

Book Description

Essential Skills—Made Easy!

PHP and MySQL Web Development: A Beginner's Guide takes you from building static web pages to creating comprehensive database-driven web applications. The book reviews HTML, CSS, and JavaScript and then explores PHP--its structure, control statements, arrays, functions, use with forms, and file handling capabilities. Next, the book examines MySQL, including SQL, the MySQL command set, and how to use it with PHP to create a relational database and build secure, databasedriven web applications. This practical resource features complete, step-by-step examples with code that you can use as templates for your own projects.

Designed for Easy Learning

  • Key Skills & Concepts--Chapter-opening lists of specific skills covered in the chapter
  • Try This--Hands-on exercises that show you how to apply your skills
  • Notes--Extra information related to the topic being covered
  • Tips--Helpful reminders or alternate ways of doing things
  • Cautions--Errors and pitfalls to avoid
  • Self Tests--End-of-chapter quizzes to reinforce your skills
  • Annotated Syntax--Example code with commentary that describes the programming techniques being illustrated

Ready-to-use code at www.mhprofessional.com

Table of Contents

  1. Cover
  2. Title Page
  3. Copyright Page
  4. Dedication
  5. Contents at a Glance
  6. Contents
  7. Acknowledgments
  8. Introduction
  9. Part I Getting Ready
    1. 1 Setting Up Your Workstation
      1. Picking a Development Tool
        1. Full-Featured Development Packages
        2. Powerful Alternatives
      2. Choosing a Testing Server
      3. Testing Environment
        1. Using Testing Browsers
        2. Considering Other Factors
    2. 2 Building Web Pages with HTML
      1. HTML5
        1. Using HTML5
        2. Setting Up Aptana
        3. Reviewing HTML
        4. Using Basic Tags
        5. Using Global Attributes
        6. Setting Paragraph Styles
        7. Applying Character Styles
        8. Displaying Special Characters
        9. Working with Images and Image Maps
        10. Adding Hyperlinks and Bookmarks
        11. Defining Forms
        12. Creating Tables
        13. Using New HTML5 Tags
        14. Understanding Deprecated HTML Tags
      2. HTML Authoring Resources
    3. 3 Styling with CSS
      1. Creating CSS
        1. Attaching CSS
        2. Understanding CSS Rules
        3. Selecting What to Format
      2. CSS Properties and Values
        1. Applying CSS Concepts
        2. Using Text Properties
        3. Implementing Page Properties
        4. Laying Out with CSS
    4. 4 Adding Dynamic Elements with JavaScript
      1. Introducing JavaScript
        1. Characteristics of JavaScript
      2. JavaScript Introduction
        1. Using JavaScript with HTML Pages
        2. JavaScript Basics
        3. Writing and Testing JavaScript
      3. Parts of JavaScript
        1. Variables and Constants
        2. Operators
        3. Statements and Expressions
        4. Functions
        5. Objects
      4. Control Structures
        1. If/Else Statements
        2. While and Do-While Statements
        3. For Statement
        4. Switch Statements
      5. Introducing Event Handlers
        1. Placing Event Handlers in Your Code
        2. Understanding Event Handler Syntax and Usage
      6. Working with the Window Event Handlers
        1. Displaying Messages When a Page Opens/Closes
        2. Placing and Removing Focus
        3. Resizing a Window
      7. Using the Mouse and Keyboard Event Handlers
        1. Working with onclick, ondblclick, and Arrays
        2. Moving the Mouse Pointer to Trigger Events
        3. Using the Keyboard Event Handlers
      8. Reviewing Forms
        1. Understanding Forms
        2. Creating Forms Using HTML
      9. Using JavaScript in Forms
        1. Naming Forms on a Web Page
        2. Form Properties and Methods
        3. Working with Form Element Properties and Methods
      10. Validating a Form
        1. Understanding Validation
        2. Using Validation with Passwords
  10. Part II Exercising the Server with PHP
    1. 5 Fundamentals of PHP
      1. About PHP
      2. Tools Needed for PHP
        1. Preparing a PHP Workstation
      3. PHP Introduction
        1. Integrating PHP with HTML
        2. Writing and Testing PHP
        3. PHP Basics
      4. Parts of PHP
        1. Types of Information
        2. Variables and Constants
        3. Operators
        4. Statements and Expressions
        5. Functions
    2. 6 PHP Control and File Handling
      1. Control Structures
        1. if/else Statements
        2. while and do-while Statements
        3. for and foreach Statements
        4. switch Statements
      2. PHP File and Directory Management
        1. Basic File Functions
        2. Additional File Functions
      3. Cookies and Session and Server Variables
        1. Session Variables
        2. Cookies
        3. Server Variables
    3. 7 PHP Arrays and Forms
      1. Using Arrays
        1. Creating Arrays
        2. Working with Arrays
        3. Looping Through Arrays
        4. Sorting Arrays
        5. Navigating in Arrays
        6. Converting Arrays To and From Strings
        7. Joining and Splitting Arrays
        8. Comparing Arrays
        9. Handling Multidimensional Arrays
      2. Building and Handling Forms
        1. Create a Form in HTML
        2. Add JavaScript to a Form
        3. Accepting and Filing Form Data in PHP
    4. 8 Putting PHP to Use
      1. User Authentication
        1. Create an Index Script
        2. Add Registration Scripts
        3. Insert Sign-In Scripts
        4. Attach a Site Page
  11. Part III Creating and Using Relational Databases with MySQL
    1. 9 Introduction to Relational Databases
      1. Databases and Relational Databases
        1. Understanding Databases
        2. Understanding a Relational Database
      2. Using phpMyAdmin
        1. Get and Install phpMyAdmin
        2. Opening and Exploring phpMyAdmin
        3. Create and Use a Database in phpMyAdmin
    2. 10 Fundamentals of MySQL and SQL
      1. About MySQL
        1. Installing and Using MySQL Workbench
        2. Understanding SQL
        3. Using MySQL
      2. Exploring the MySQL Language
        1. Reviewing MySQL Word Usage
        2. Using MySQL Operators
        3. Exploring MySQL Functions
    3. 11 Implementing MySQL Command Statements
      1. MySQL Commands
        1. Understanding the MySQL Command Structure
        2. Preparing the MySQL Workbench
      2. Create Databases and Tables
        1. Creating and Using a Database
        2. Creating a Table and Its Columns
        3. Reviewing MySQL Data Types
      3. Insert Data into Tables
        1. Inserting Data
      4. Select, Replace, Update, and Delete Data in Tables
        1. Selecting Data
        2. Replacing Data
        3. Updating Data
        4. Deleting Data
      5. Alter, Rename, and Drop Tables and Databases
        1. Altering Tables and Databases
        2. Renaming Tables
        3. Dropping Tables and Databases
      6. Create and Use Events, Views, and Triggers
        1. Using Events
        2. Using Views
        3. Using Triggers
  12. Part IV Powering Databases with MySQL and PHP
    1. 12 Using a MySQL Database with PHP
      1. Bringing PHP and MySQL Together
        1. Database Manipulation
        2. Database Information
        3. Database Administration
        4. Combining PHP MySQL Functions
      2. Working with Forms and Databases
        1. Expanding PHP Form Handling
        2. Facilitating User Interaction
        3. Interacting with a Database
        4. Improving Security
    2. 13 Registering and Responding to Users
      1. Application Design
        1. Design Template and CSS
        2. Database Design
      2. Creating the Scripts
        1. Administrator Authentication
        2. Database Entry and Maintenance
    3. 14 Handling Online Purchases
      1. Application Design
        1. Design Template and CSS
        2. Database Design
      2. Creating the Book List and Customer Sales Scripts
        1. Book List and Selection
        2. Customer Sign-in and Verification
        3. Sales and Confirmation
      3. Invoicing
        1. Building an Invoice
        2. Deleting Sales
        3. Writing an Invoice Record
  13. Index