Book description
MySQL is the leading open source database on the market and PHP continues to dominate the server side of the scripting market—together, they are the most popular and common team for creating dynamic, database-driven web sites. This comprehensive book covers the newest version of PHP and MySQL and is packed with extensive code examples, full working applications, and valuable troubleshooting advice. You’ll explore installing, developing, and debugging the latest versions of PHP and MySQL and get insight on advanced topics such as error handling, debugging, PEAR, security, HTTP, cookies, and OOP.
Table of contents
- Copyright
- About the Authors
- Credits
- Acknowledgments
- Introduction
-
I. Introducing PHP
- 1. Why PHP and MySQL?
- 2. Server-Side Scripting Overview
- 3. Getting Started with PHP
-
4. Learning PHP Syntax and Variables
- 4.1. PHP Is Forgiving
- 4.2. HTML Is Not PHP
- 4.3. PHP's Syntax Is C-Like
- 4.4. Comments
- 4.5. Variables
- 4.6. Types in PHP: Don't Worry, Be Happy
- 4.7. Type Summary
- 4.8. The Simple Types
- 4.9. Output
- 4.10. Summary
- 5. Learning PHP Control Structures and Functions
- 6. Passing Information with PHP
-
7. Learning PHP String Handling
- 7.1. Strings in PHP
- 7.2. String Functions
- 7.3. Summary
-
8. Learning Arrays
- 8.1. The Uses of Arrays
- 8.2. What Are PHP Arrays?
- 8.3. Creating Arrays
- 8.4. Retrieving Values
- 8.5. Multidimensional Arrays
- 8.6. Inspecting Arrays
- 8.7. Deleting from Arrays
-
8.8. Iteration
- 8.8.1. Support for iteration
- 8.8.2. Using iteration functions
- 8.8.3. Our favorite iteration method: foreach
- 8.8.4. Iterating with current() and next()
- 8.8.5. Starting over with reset()
- 8.8.6. Reverse order with end() and prev()
- 8.8.7. Extracting keys with key()
- 8.8.8. Empty values and the each() function
- 8.8.9. Walking with array_walk()
- 8.9. Summary
- 9. Learning PHP Number Handling
- 10. PHP Gotchas
-
II. MySQL Database Integration
- 11. Introducing Databases and MySQL
- 12. Installing MySQL
- 13. Learning Structured Query Language (SQL)
- 14. Learning Database Administration and Design
- 15. Integrating PHP and MySQL
- 16. Performing Database Queries
- 17. Integrating Web Forms and Databases
- 18. Improving Database Efficiency
- 19. MySQL Gotchas
-
III. More PHP
-
20. Introducing Object-Oriented PHP
- 20.1. What Is Object-Oriented Programming?
- 20.2. Basic PHP Constructs for OOP
- 20.3. Advanced OOP Features
- 20.4. Introspection Functions
- 20.5. Extended Example: HTML Forms
- 20.6. Gotchas and Troubleshooting
- 20.7. OOP Style in PHP
- 20.8. Summary
- 21. Advanced Array Functions
- 22. Examining Regular Expressions
- 23. Working with the Filesystem
- 24. Working with Cookies and Sessions
- 25. Learning PHP Types
- 26. Learning PHP Advanced Functions
- 27. Performing Math with PHP
- 28. Securing PHP
-
29. Learning PHP Configuration
- 29.1. Viewing Environment Variables
-
29.2. Understanding PHP Configuration
-
29.2.1. Compile-time options
- 29.2.1.1. --with-apache[=DIR] or --with-apache2=[DIR]
- 29.2.1.2. --with-apxs[=DIR] or --with-apxs2[=DIR]
- 29.2.1.3. --with-[database][=DIR]
- 29.2.1.4. --with-mcrypt[=DIR]
- 29.2.1.5. --with-java[=DIR]
- 29.2.1.6. --with-xmlrpc
- 29.2.1.7. --with-dom[=DIR]
- 29.2.1.8. --enable-bcmath
- 29.2.1.9. --enable-calendar
- 29.2.1.10. --with-config-file-path=DIR
- 29.2.1.11. --enable-url-includes
- 29.2.1.12. --disable-url-fopen-wrapper
- 29.2.2. CGI compile-time options
- 29.2.3. Apache configuration files
-
29.2.4. The php.ini file
- 29.2.4.1. short_open_tag = Off
- 29.2.4.2. disable_functions = [function1, function2, function3 . . . functionn]
- 29.2.4.3. max_execution_time = 30
- 29.2.4.4. error_reporting = E_ALL & ~E_NOTICE
- 29.2.4.5. error_prepend_string = ["<font color=ff0000>"]
- 29.2.4.6. warn_plus_overloading = Off
- 29.2.4.7. variables_order = EGPCS
- 29.2.4.8. gpc_order = GPC
- 29.2.4.9. auto-prepend-file = [path/to/file]
- 29.2.4.10. auto-append-file = [path/to/file]
- 29.2.4.11. include_path = [DIR]
- 29.2.4.12. doc_root = [DIR]
- 29.2.4.13. upload_tmp_dir = [DIR]
- 29.2.4.14. session.save-handler = files
- 29.2.4.15. ignore_user_abort = [On/Off]
-
29.2.1. Compile-time options
- 29.3. Improving PHP Performance
- 29.4. Summary
- 30. Handing Exceptions with PHP
- 31. Debugging PHP Programs
-
32. Learning PHP Style
- 32.1. The Uses of Style
- 32.2. Readability
- 32.3. Maintainability
- 32.4. Robustness
- 32.5. Efficiency and Conciseness
- 32.6. HTML Mode or PHP Mode?
- 32.7. Separating Code from Design
- 32.8. Summary
-
20. Introducing Object-Oriented PHP
-
IV. Other Databases
- 33. Connecting PHP and PostgreSQL
- 34. Using PEAR DB with PHP
- 35. An Overview of Oracle
- 36. An Introduction to SQLite
-
V. Connections
- 37. Sending E-Mail with PHP
-
38. Integrating PHP and Java
- 38.1. PHP for Java programmers
- 38.2. Integrating PHP and Java
- 38.3. Summary
- 39. Integrating PHP and JavaScript
- 40. Integrating PHP and XML
- 41. Creating and Consuming Web Services with PHP
- 42. Creating Graphics with PHP
-
VI. Case Studies
- 43. Developing a Weblog with PHP
-
44. A Trivia Game
- 44.1. Concepts Used in This Chapter
- 44.2. The Game
- 44.3. The Code
- 44.4. General Design Considerations
- 44.5. Summary
- 45. Data Visualization with Venn Diagrams
- A. PHP for C Programmers
-
B. PHP for Perl Hackers
- B.1. Similarities
-
B.2. Differences
- B.2.1. PHP is HTML-embedded
- B.2.2. No @ or % variables
- B.2.3. Arrays versus hashes
- B.2.4. Specifying arguments to functions
- B.2.5. Variable scoping in functions
- B.2.6. No module system as such
- B.2.7. Break and continue rather than next and last
- B.2.8. No elsif
- B.2.9. More kinds of comments
- B.2.10. Regular expressions
- B.3. Miscellaneous Tips
- B.4. Guide to the Book
- C. PHP for HTML Coders
- D. PHP Resources
- E. PEAR
Product information
- Title: PHP6 and MySQL® 6 Bible
- Author(s):
- Release date: January 2009
- Publisher(s): Wiley
- ISBN: 9780470384503
You might also like
book
JavaServer Pages, 3rd Edition
JavaServer Pages (JSP) has built a huge following since the release of JSP 1.0 in 1999, …
book
AJAX and JavaServer™ Faces
Based on material from the forthcoming second edition of Core JavaServer™ Faces by David Geary and …
book
MySQL® Crash Course
MySQL is one of the most popular database management systems available, powering everything from Internet powerhouses …
book
Mongrel
This shortcut teaches you how to use Mongrel, the new high-performance web application container for Rails. …