An edition of Expert PHP and MySQL (2010)

Expert PHP and MySQL

My Reading Lists:

Create a new list



Buy this book

Last edited by MARC Bot
August 22, 2024 | History
An edition of Expert PHP and MySQL (2010)

Expert PHP and MySQL

Looks at the techniques of creating applications using PHP with MySQL, with information on such topics as design patterns, complex queries, iterators, closures, caching, PHP extensions, and Sphinx.

Publish Date
Publisher
Wiley Pub.
Language
English
Pages
587

Buy this book

Previews available in: English

Edition Availability
Cover of: Expert PHP and MySQL
Expert PHP and MySQL
2010, Wiley Pub.
in English

Add another edition?

Book Details


Table of Contents

Introduction
Page XXIX
Chapter 1. Techniques Every Expert Programmer Needs to Know
Page 1
Object-Oriented PHP
Page 2
Instantiation and Polymorphism
Page 2
Interfaces
Page 7
Magic Methods and Constants
Page 8
Design Patterns
Page 11
Using MySQL Joins
Page 20
INNER JOIN
Page 22
OUTER JOIN
Page 24
Other JOIN Syntax
Page 26
Complex Joins
Page 27
MySQL Unions
Page 28
GROUP BY in MySQL Queries
Page 30
WITH ROLLUP
Page 31
HAVING
Page 32
Logical Operations and Flow Control in MySQL
Page 33
Logic Operators
Page 33
Flow Control
Page 34
Maintaining Relational Integrity
Page 35
Constraints
Page 36
NOT NULL
Page 36
UNSIGNED
Page 36
ENUM and SET
Page 37
UNIQUE KEY
Page 37
FOREIGN KEY
Page 38
Using Server SQL Modes
Page 41
Storage Engine Integrity
Page 45
What MySQL Does Not Tell You
Page 46
What's Missing?
Page 46
Subqueries in MySQL
Page 46
Subquery
Page 46
Correlated Subquery
Page 47
Derived Table
Using Regular Expressions
Page 49
General Patterns
Page 50
Expert Regular Expressions
Page 52
Putting It All Together in PHP
Page 55
Regular Expressions in MySQL
Page 60
Summary
Page 63
Chapter 2. Advanced PHP Concepts
Page 65
A Problem That Needs Solving
Page 65
Iterators and the SPL
Page 67
A Sample View for the Application
Page 67
The Iterator Interface
Page 69
The Countable Interface
Page 73
The SeekableIterator Interface and Pagination
Page 75
The ArrayAccess Interface
Page 77
Lambda Functions and Closures
Page 78
The Old Way: Lambda-Style Functions
Page 78
Understanding Closures
Page 81
Using the Query Builder for Prototyping
Page 83
Summary
Page 85
Chapter 3. MySQL Drivers and Storage Engines
Page 87
MySQL Drivers
Page 88
About MySQL Storage Engines
Page 89
Obtaining Storage Engine Information
Page 89
Default Storage Engines
Page 93
MyISAM
Page 93
InnoDB
Page 97
Memory
Page 103
Blackhole
Page 108
Archive
Page 109
Merge
Page 110
CSV
Page 112
Federated
Page 112
Other MySQL Supplied Engines
Page 118
Falcon
Page 118
Maria
Page 120
Pluggable Engines
Page 121
InnoDB Plugin
Page 121
PBXT
Page 122
XtraDB
Page 123
Engines As Standalone Products
Page 124
InfiniDB
Page 124
TokuDB
Page 124
Infobright
Page 125
Other MySQL Offerings
Page 125
Storage Engine Patch Products
Page 125
MySQL-Related Products
Page 126
Other Engines
Page 127
Integrated Hardware Engines
Page 128
Other Solutions
Page 128
Wafflegrid
Page 129
Summary
Page 129
Chapter 4. Improving Performance Through Caching
Page 131
eAccelerator and APC
Page 132
Installing and Configuring APC
Page 132
Installing and Configuring eAccelerator
Page 133
User Cache
Page 134
Checking the Cache Status
Page 135
When to Use APC and eAccelerator
Page 138
memcached
Page 139
What Is memcached?
Page 139
What memcached Does for You
Page 139
How Does memcached Work?
Page 139
How to Use memcached
Page 141
What Is Gearman?
Page 144
Caching Strategies
Page 144
Installing memcached
Page 145
Starting memcached
Page 148
Startup Scripts
Page 149
Testing Your memcached Installation
Page 151
memcached Clients
Page 153
Libmemcached
Page 153
Libmemcached Features
Page 154
Libmemcached Utility Programs
Page 154
Installing Libmemcached
Page 155
Libmemcached Utility Programs
Page 155
memcat
Page 156
memflush
Page 156
memcp
Page 157
memstat
Page 157
memrm
Page 157
memslap
Page 157
memerror
Page 158
PECL/Memcached
Page 160
Connecting, Instantiation
Page 162
Setting Client Behavior
Page 162
Putting and Retrieving Data
Page 163
Append and Prepend
Page 166
Delete
Page 168
Increment and Decrement
Page 168
Multi-get
Page 169
Multi-set
Page 170
Cache Locality Using byKey Methods and Multi get/set
Page 171
GetDelayed
Page 173
CAS
Page 174
Statistics
Page 176
Server List
Page 178
Error Handling
Page 178
Practical Caching
Page 180
Memcached Proxy: Moxi
Page 185
Other "Memcapable" Key-Value Stores
Page 186
Tokyo Tyrant
Page 187
Summary
Page 188
Chapter 5. Memcached and MySQL
Page 191
The Memcached Functions for MySQL
Page 191
How the Memcached Functions for MySQL Work
Page 192
Installing the Memcached Functions for MySQL
Page 193
Prerequisites
Page 193
Configure the Source
Page 194
Build the Source
Page 194
Install the UDF
Page 195
Checking Installation
Page 196
Using the Memcached Functions for MySQL
Page 196
Establishing a Connection to the Memcached Server
Page 197
Data Setting Functions
Page 198
Data Fetching Functions
Page 204
Increment and Decrement
Page 204
Behavioral Functions
Page 206
Statistical Functions
Page 209
Version Functions
Page 211
Fun with Triggers (and UDFs)
Page 212
Read-Through Caching with Simple Select Statements
Page 216
Updates
Page 219
Summary
Page 220
Chapter 6. Advanced MySQL
Page 221
Views
Page 221
Access Permissions
Page 223
Additional Information about Views
Page 225
Stored Procedures and Functions
Page 226
General Attributes
Page 226
Stored Routine Logic
Page 228
Using Stored Routines Privileges and Meta Data
Page 230
Extending Stored Routines
Page 231
Stored Routine Disadvantages
Page 231
User Defined Functions
Page 231
Triggers
Page 232
No Triggers
Page 233
Trigger Syntax
Page 233
Insert Triggers
Page 233
Update Triggers
Page 234
Delete Triggers
Page 235
Replace Triggers
Page 236
Trigger Permissions
Page 237
Transactions
Page 237
Atomicity
Page 238
Consistency
Page 240
Isolation
Page 242
Durability
Page 247
Implied Commit
Page 250
Replication
Page 250
Replication Purposes
Page 250
Replication Setup
Page 251
Testing MySQL Replication
Page 254
How Does MySQL Replication Work?
Page 259
Important Configuration Options
Page 260
Important Replication Commands
Page 261
Breaking Replication
Page 262
Using Replication Selectively
Page 263
The Issues with MySQL Replication
Page 264
The Benefits of MySQL Replication
Page 264
Events
Page 264
Creating Events
Page 265
Enabling the Events Scheduler
Page 267
Altering Events
Page 268
Event Privileges
Page 269
Event Meta Data
Page 269
Summary
Page 270
Chapter 7. Extending MySQL with User-Defined Functions
Page 271
Introduction to UDFs
Page 272
Developing a UDF
Page 273
UDF Development Requirements
Page 273
UDF Required Functions
Page 274
A Practical UDF Example
Page 274
UDF High-Level Design
Page 275
Designing an Algorithm to Use for Your UDF
Page 277
Implementing the Program
Page 277
Building the UDF
Page 292
Installing the UDF
Page 294
Running Your New UDF
Page 295
Using a UDF with PHP
Page 296
Connecting and Disconnecting to MySQL
Page 296
Returning the Result Set Array
Page 297
Other UDF SQL Statements
Page 300
Debugging a UDF
Page 300
Attaching gdb to an Already Running Process
Page 301
Setting a BreakPoint and Stepping through Code
Page 302
Dealing with Literal Values
Page 304
Debugging Summary
Page 304
Summary
Page 305
Chapter 8. Writing PHP Extensions
Page 307
Setting Up the Build Environment
Page 308
Creating an Extension with ext_skel
Page 309
Creating and Compiling Skeleton Code
Page 309
Using a Function Definitions File
Page 312
Generating Help Files
Page 313
Creating an Extension with CodeGen_PECL
Page 314
Creating the Basic XML File
Page 314
Defining Functions
Page 316
Defining Constants, INI Directives, and Globals
Page 318
Defining Objects, Methods, and Properties
Page 319
Variables in PHP Extensions
Page 321
Setting and Testing zvals
Page 323
Reading and Comparing zvals
Page 324
Dealing with Strings as zvals
Page 326
Advanced Memory Management
Page 328
Using Functions in Extensions
Page 329
Basic Definitions
Page 329
Using Arguments
Page 331
Defining Argument Information
Page 334
Returning Values
Page 334
Built-In Functions
Page 335
Creating and Consuming PHP API Functions
Page 336
More Notes and Creating Helper Functions
Page 339
Input/Output
Page 340
Standard Out
Page 340
Files and Streams
Page 341
Networking
Page 344
Errors and Warnings
Page 346
Arrays and Hash Tables
Page 347
Building and Accessing Arrays
Page 347
Accessing and Modifying Hash Tables
Page 349
Objects and Interfaces
Page 349
Creating a Class
Page 350
Interacting with Objects
Page 355
Constants, INI Directives, and Globals
Page 357
Constants
Page 357
Globals and INI Directives
Page 358
Describing an Extension
Page 361
Printing a Description
Page 361
Building a Table
Page 362
Specifying a Logo
Page 362
Summary
Page 364
Chapter 9. Full-Text Searching
Page 365
MySQL Fulltext Indexes
Page 365
Using MySQL Fulltext Indexes
Page 367
MySQL Fulltext Index Issues
Page 368
A Better Solution: The Sphinx Full-Text Search Engine
Page 370
Sphinx Configuration and Installation
Page 371
Sphinx.conf Settings
Page 382
Starting Sphinx
Page 383
Searching Sphinx
Page 385
Delta Indexes
Page 389
Merging Indexes
Page 394
Developing Applications That Use Sphinx
Page 395
Sphinx and PHP
Page 399
Summary
Page 400
Chapter 10. Multi-Tasking in PHP and MySQL
Page 401
Gearman
Page 401
What Is Gearman?
Page 402
Installing and Running Gearman
Page 404
Using the Gearman MySQL UDFs
Page 407
PHP and Gearman
Page 409
Narada: A Search Engine Application
Page 412
Obtaining Narada
Page 413
Narada Components
Page 413
Database Tables for the Search Engine Application
Page 415
Sphinx Setup
Page 416
Gearman Workers
Page 429
Index Page
Page 435
One Other Tidbit of Code
Page 438
The Big Picture
Page 439
Running Narada
Page 439
To-Do List for Narada
Page 440
Other Job Server Systems
Page 442
Summary
Page 442
Chapter 11. Rewrite Rules
Page 443
Using Rewrite Rules
Page 444
Understanding the Purpose and Structure of Rewrite Rules
Page 444
Understanding and Controlling Rewrite Rule Flow
Page 445
Conditional Rules
Page 447
Logging and Optimization
Page 450
Rewrite Maps
Page 451
Built-In Maps
Page 451
Random and Text Lookups
Page 452
Using PHP and MySQL
Page 452
Summary
Page 456
Chapter 12. User Authentication
Page 457
Designing the Database
Page 458
HTTP-Based Authentication
Page 460
Basic Authentication
Page 461
Digest Authentication
Page 463
Pure PHP Authentication
Page 466
Using PHP Sessions
Page 467
Building Secure Cookies
Page 471
Access Control Lists
Page 473
Summary
Page 475
Chapter 13. Understanding the INFORMATION_SCHEMA
Page 477
Using the INFORMATION_SCHEMA
Page 478
Table Objects Tables
Page 479
Other Database Objects Tables
Page 481
MySQL Status Tables
Page 482
PROCESSLIST (5.1)
Page 482
SESSION_STATUS/GLOBAL_STATUS (5.1)
Page 484
SESSION_VARIABLES/GLOBAL_VARIABLES (5.1)
Page 485
MySQL Meta Data Tables
Page 486
CHARACTER_SETS
Page 486
COLLATIONS
Page 487
COLLATION_CHARACTER_SET_APPLICABILITY
Page 488
MySQL ACL Permissions Tables
Page 488
USER_PRIVILEGES
Page 488
SCHEMA_PRIVILEGES
Page 489
TABLE_PRIVILEGES
Page 489
COLUMN_PRIVILEGES
Page 490
INFORMATION_SCHEMA Extensions
Page 491
SHOW Cross Reference
Page 491
Summary
Page 492
Chapter 14. Security
Page 493
Hardening Your MySQL Server
Page 494
Installation Defaults
Page 494
Operating System Security
Page 495
MySQL Security Permissions
Page 500
Additional Database Security
Page 500
Auditing
Page 501
Encoding Data
Page 501
Bi-directional Encoding
Page 505
Single-Directional Encoding
Page 506
PHP Security Recipes
Page 506
Protecting against SQL Injection
Page 507
Protecting against Replay Attacks
Page 509
Protecting against XSS
Page 511
Protecting against CSRF
Page 514
Automation Attacks
Page 516
Summary
Page 517
Chapter 15. Command-Line and Web Services
Page 517
Creating Command-Line Scripts
Page 517
Reading Command-Line Input
Page 518
Prompting for Input
Page 520
Completed Classes
Page 521
Setting Up Cron Jobs
Page 522
Bonus: Output in Color
Page 523
Creating Web Services
Page 524
RESTful Web Services
Page 524
SOAP Web Services
Page 532
Getting Started with the SOAP Library
Page 533
Summary
Page 541
Chapter 16. Optimization and Debugging
Page 543
Debugging PHP
Page 543
Creating Stack Traces
Page 544
Optimizing Queries
Page 545
Reducing SQL
Page 545
Identifying SQL Statements
Page 545
Optimizing SELECT
Page 546
Optimizing UPDATE
Page 556
Optimizing DELETE
Page 556
Optimizing INSERT
Page 558
Optimizing REPLACE
Page 558
INSERT ... ON DUPLICATE KEY UPDATE
Page 558
Debugging MySQL
Page 560
Error Log
Page 560
Slow Query Log
Page 561
Processlist
Page 562
Other Commands
Page 564
Using a Debugger with MySQL
Page 564
Summary
Page 565
Index
Page 567

Edition Notes

"Wrox programmer to programmer"--Cover.

Includes index.

Published in
Indianapolis, IN
Series
Wrox expert

Classifications

Dewey Decimal Class
005.2/762
Library of Congress
QA76.73.P224 C87 2010

The Physical Object

Pagination
xxxiii, 587 p. :
Number of pages
587

Edition Identifiers

Open Library
OL25086207M
ISBN 10
0470563125
ISBN 13
9780470563120
LCCN
2010920658
OCLC/WorldCat
430842611, 744652817

Work Identifiers

Work ID
OL16239020W

Community Reviews (0)

No community reviews have been submitted for this work.

Lists

This work does not appear on any lists.

History

Download catalog record: RDF / JSON
August 22, 2024 Edited by MARC Bot import existing book
October 18, 2022 Edited by ImportBot import existing book
June 30, 2019 Edited by MARC Bot import existing book
November 4, 2011 Created by LC Bot import new book