Expert PHP and MySQL

Overview

Best practices and expert techniques for even the most demanding MySQL-driven PHP applications

PHP is the world's most popular, general-purpose, open-source scripting language and MySQL is the world's most popular open-source database. This expert-level book begins with a brief overview of the two technologies and quickly moves on to coverage of advanced programming techniques, as well as the exciting new features of the PHP 5.3 release.

...

See more details below
Paperback
$35.44
BN.com price
(Save 21%)$44.99 List Price
Other sellers (Paperback)
  • All (10) from $19.99   
  • New (7) from $23.89   
  • Used (3) from $19.99   

Overview

Best practices and expert techniques for even the most demanding MySQL-driven PHP applications

PHP is the world's most popular, general-purpose, open-source scripting language and MySQL is the world's most popular open-source database. This expert-level book begins with a brief overview of the two technologies and quickly moves on to coverage of advanced programming techniques, as well as the exciting new features of the PHP 5.3 release.

Written by three of PHP and MySQL experts and veteran authors, this resource focuses on best practices and expert techniques that can be applied to the most difficult MySQL-driven PHP applications. The authors share design patterns and tools that they themselves have tested in order to save you valuable time usually spent on figuring things out via trial and error.

  • Reveals best practices and advanced techniques for handling challenges you may face with MySQL-driven PHP apps
  • Reviews practical data reporting techniques for separating business logic from presentation
  • Explains how to obtain improved performance and flexibility through caching, multi-tasking, PHP extensions, and MySQL user defined functions
  • Discusses security, optimization, and debugging
  • Shares author-tested design patterns and tools to save you time and effort

Packed with helpful examples and indispensable advice, this book shares tips and tricks that you can immediately apply to your projects.

Read More Show Less

Product Details

  • ISBN-13: 9780470563120
  • Publisher: Wiley
  • Publication date: 3/29/2010
  • Edition number: 1
  • Pages: 624
  • Product dimensions: 7.30 (w) x 9.20 (h) x 1.30 (d)

Meet the Author

Andrew Curioso is a senior software engineer at MyVBO (Virtual Business Office) creating an innovative and scalable infrastructure for Rich Internet Applications using PHP and MySQL.

Ronald Bradford is a technology strategist and advisor specializing in MySQL, Drizzle and related web technologies. With a primary focus on architecture, design, performance analysis and scalability of web applications, his consulting portfolio ranges from Internet startups to Fortune 500 companies.

Patrick Galbraith is a principal software engineer at Lycos, adding new PHP and MySQL offerings for Tripod Users, switching remaining apps using Oracle to MySQL as well as other interesting projects.

Read More Show Less

Table of Contents

INTRODUCTION XXIX

CHAPTER 1: TECHNIQUES EVERY EXPERT PROGRAMMER NEEDS TO KNOW 1

Object-Oriented PHP 2

Using MySQL Joins 20

MySQL Unions 28

GROUP BY in MySQL Queries 30

Logical Operations and Flow Control in MySQL 33

Maintaining Relational Integrity 35

Subqueries in MySQL 46

Using Regular Expressions 49

Summary 63

CHAPTER 2: ADVANCED PHP CONCEPTS 65

A Problem That Needs Solving 65

Iterators and the SPL 67

Lambda Functions and Closures 78

Summary 85

CHAPTER 3: MYSQL DRIVERS AND STORAGE ENGINES 87

MySQL Drivers 88

About MySQL Storage Engines 89

Default Storage Engines 93

Other MySQL Supplied Engines 118

Pluggable Engines 121

Engines as Standalone Products 124

Other MySQL Offerings 125

Summary 129

CHAPTER 4: IMPROVING PERFORMANCE THROUGH CACHING 131

eAccelerator and APC 132

memcached 138

Installing memcached 145

Starting memcached 148

Libmemcached 153

Libmemcached Utility Programs 155

PECL/Memcached 158

Practical Caching 180

Summary 188

CHAPTER 5: MEMCACHED AND MYSQL 191

The Memcached Functions for MySQL 191

How the Memcached Functions for MySQL Work 192

Installing the Memcached Functions for MySQL 193

Using the Memcached Functions for MySQL 196

Summary 220

CHAPTER 6: ADVANCED MYSQL 221

Views 221

Stored Procedures and Functions 226

Triggers 232

Transactions 237

Replication 250

Events 264

Summary 270

CHAPTER 7: EXTENDING MYSQL WITH USER-DEFINED FUNCTIONS 271

Introduction to UDFs 272

Developing a UDF 273

A Practical UDF Example 274

Other UDF SQL Statements 300

Debugging a UDF 300

Summary 305

CHAPTER 8: WRITING PHP EXTENSIONS 307

Setting Up the Build Environment 308

Creating an Extension with ext_skel 309

Creating an Extension with CodeGen_PECL 314

Variables in PHP Extensions 321

Using Functions in Extensions 329

Input/Output 340

Arrays and Hash Tables 347

Objects and Interfaces 349

Constants, INI Directives, and Globals 357

Describing an Extension 361

Summary 364

CHAPTER 9: FULL-TEXT SEARCHING 365

MySQL FULLTEXT Indexes 365

A Better Solution: The Sphinx Full-Text Search Engine 369

Developing Applications That Use SPHINX 395

Summary 399

CHAPTER 10: MULTI-TASKING IN PHP AND MYSQL 401

Gearman 401

What Is Gearman? 402

Narada: A Search Engine Application 412

Summary 442

CHAPTER 11: REWRITE RULES 443

Using Rewrite Rules 444

Rewrite Maps 451

Summary 456

CHAPTER 12: USER AUTHENTICATION 457

Designing the Database 458

HTTP-Based Authentication 460

Pure PHP Authentication 466

Access Control Lists 473

Summary 475

CHAPTER 13:UNDERSTANDING THE INFORMATION_SCHEMA 477

Using the INFORMATION_SCHEMA 478

Table Objects Tables 479

Other Database Objects Tables 481

MySQL Status Tables 482

MySQL Meta Data Tables 486

MySQL ACL Permissions Tables 488

INFORMATION_SCHEMA Extensions 491

SHOW Cross Reference 491

Summary 492

CHAPTER 14: SECURITY 493

Hardening Your MySQL Server 493

Encoding Data 501

PHP Security Recipes 506

Summary 516

CHAPTER 15: COMMAND-LINE AND WEB SERVICES 517

Creating Command-Line Scripts 517

Creating Web Services 524

Summary 541

CHAPTER 16: OPTIMIZATION AND DEBUGGING 543

Debugging PHP 543

Optimizing Queries 545

Debugging MySQL 560

Summary 565

INDEX 567

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)