Learning PHP, MySQL & JavaScript, 7th Edition

Book description

Build interactive, data-driven websites with the potent combination of open source technologies and web standards, even if you have only basic HTML knowledge. With the latest edition of this popular hands-on guide, you'll tackle dynamic web programming using the most recent versions of today's core technologies: PHP, MySQL, JavaScript, CSS, HTML5, jQuery, Node.js, and the powerful React library.

Web designers will learn how to use these technologies together while picking up valuable web programming practices along the way, including how to optimize websites for mobile devices. You'll put everything together to build a fully functional social networking site suitable for both desktop and mobile browsers.

  • Explore MySQL from database structure to complex queries
  • Use the MySQL PDO extension, PHP's improved MySQL interface
  • Create dynamic PHP web pages that tailor themselves to the user
  • Manage cookies and sessions and maintain a high level of security
  • Enhance JavaScript with the React library
  • Use Ajax calls for background browser-server communication
  • Style your web pages by acquiring CSS skills
  • Implement HTML5 features including geolocation, audio, video, and the canvas element
  • Reformat your websites into mobile web apps

Publisher resources

View/Submit Errata

Table of contents

  1. Learning PHP, MySQL & JavaScript
  2. Learning PHP, MySQL & JavaScript
  3. Brief Table of Contents (Not Yet Final)
  4. 1. Introduction to Dynamic Web Content
    1. HTTP and HTML: Berners-Lee’s Basics
    2. The Request/Response Procedure
    3. The Benefits of PHP, MySQL, JavaScript, CSS, and HTML
      1. MariaDB: The MySQL Clone
      2. Using PHP
      3. Using MySQL
      4. Using JavaScript
      5. Using CSS
    4. And Then There’s HTML5
    5. The Apache Web Server
    6. Node.js: An Alternative to Apache
    7. About Open Source
    8. Bringing It All Together
    9. Questions
  5. 2. Setting Up a Development Server
    1. What Is a WAMP, MAMP, or LAMP?
    2. Installing AMPPS on Windows
      1. Testing the Installation
      2. Accessing the Document Root (Windows)
      3. Alternative WAMPs
    3. Installing AMPPS on macOS
      1. Accessing the Document Root (macOS)
    4. Installing a LAMP on Linux
    5. Working Remotely
      1. Logging In
      2. Using SFTP or FTPS
    6. Using a Code Editor
    7. Questions
  6. 3. Introduction to PHP
    1. Incorporating PHP Within HTML
    2. This Book’s Examples
    3. The Structure of PHP
      1. Using Comments
      2. Basic Syntax
      3. Variables
      4. Operators
      5. Variable Assignment
      6. Multiline Commands
      7. Variable Typing
      8. Constants
      9. Predefined Constants
      10. The Difference Between the echo and print Commands
      11. Functions
      12. Variable Scope
    4. Questions
  7. 4. Expressions and Control Flow in PHP
    1. Expressions
      1. TRUE or FALSE?
      2. Literals and Variables
    2. Operators
      1. Operator Precedence
      2. Associativity
      3. Relational Operators
    3. Conditionals
      1. The if Statement
      2. The else Statement
      3. The elseif Statement
      4. The switch Statement
      5. The ? (or ternary) Operator
    4. Looping
      1. while Loops
      2. do...while Loops
      3. for Loops
      4. Breaking Out of a Loop
      5. The continue Statement
    5. Implicit and Explicit Casting
    6. PHP Dynamic Linking
    7. Dynamic Linking in Action
    8. Questions
  8. 5. PHP Functions and Objects
    1. PHP Functions
      1. Defining a Function
      2. Returning a Value
      3. Returning an Array
      4. Passing Arguments by Reference
      5. Returning Global Variables
      6. Recap of Variable Scope
    2. Including and Requiring Files
      1. The include Statement
      2. Using include_once
      3. Using require and require_once
    3. PHP Version Compatibility
    4. PHP Objects
      1. Terminology
      2. Declaring a Class
      3. Creating an Object
      4. Accessing Objects
      5. Cloning Objects
      6. Constructors
      7. Destructors
      8. Writing Methods
      9. Declaring Properties
      10. Declaring Constants
      11. Property and Method Scope
      12. Static Methods
      13. Static Properties
      14. Inheritance
    5. Questions
  9. 6. PHP Arrays
    1. Basic Access
      1. Numerically Indexed Arrays
      2. Associative Arrays
      3. Assignment Using the array Keyword
    2. The foreach...as Loop
    3. Multidimensional Arrays
    4. Using Array Functions
      1. is_array
      2. count
      3. sort
      4. shuffle
      5. explode
      6. extract
      7. compact
      8. reset
      9. end
    5. Questions
  10. 7. Practical PHP
    1. Using printf
      1. Precision Setting
      2. String Padding
      3. Using sprintf
    2. Date and Time Functions
      1. Date Constants
      2. Using checkdate
    3. File Handling
      1. Checking Whether a File Exists
      2. Creating a File
      3. Reading from Files
      4. Copying Files
      5. Moving a File
      6. Deleting a File
      7. Updating Files
      8. Locking Files for Multiple Accesses
      9. Reading an Entire File
      10. Uploading Files
    4. System Calls
    5. Questions
  11. 8. Introduction to MySQL
    1. MySQL Basics
    2. Summary of Database Terms
    3. Accessing MySQL via the Command Line
      1. Starting the Command-Line Interface
      2. Using the Command-Line Interface
      3. MySQL Commands
      4. Data Types
    4. Indexes
      1. Creating an Index
      2. Querying a MySQL Database
      3. Joining Tables Together
      4. Using Logical Operators
    5. MySQL Functions
    6. Accessing MySQL via phpMyAdmin
    7. Questions
  12. 9. Mastering MySQL
    1. Database Design
      1. Primary Keys: The Keys to Relational Databases
    2. Normalization
      1. First Normal Form
      2. Second Normal Form
      3. Third Normal Form
      4. When Not to Use Normalization
    3. Relationships
      1. One-to-One
      2. One-to-Many
      3. Many-to-Many
      4. Databases and Anonymity
    4. Transactions
      1. Transaction Storage Engines
      2. Using BEGIN
      3. Using COMMIT
      4. Using ROLLBACK
    5. Using EXPLAIN
    6. Backing Up and Restoring
      1. Using mysqldump
      2. Creating a Backup File
      3. Restoring from a Backup File
      4. Dumping Data in CSV Format
      5. Planning Your Backups
    7. Questions
  13. 10. Accessing MySQL Using PHP
    1. Querying a MySQL Database with PHP
      1. The Process
      2. Creating a Login File
      3. Connecting to a MySQL Database
    2. A Practical Example
      1. The $_POST Array
      2. Deleting a Record
      3. Displaying the Form
      4. Querying the Database
      5. Running the Program
    3. Practical MySQL
      1. Creating a Table
      2. Describing a Table
      3. Dropping a Table
      4. Adding Data
      5. Retrieving Data
      6. Updating Data
      7. Deleting Data
      8. Using AUTO_INCREMENT
      9. Performing Additional Queries
    4. Preventing Hacking Attempts
      1. Steps You Can Take
      2. Using Placeholders
      3. Preventing JavaScript Injection into HTML
    5. Questions
  14. About the Author

Product information

  • Title: Learning PHP, MySQL & JavaScript, 7th Edition
  • Author(s): Robin Nixon
  • Release date: August 2024
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098152352