
Learning PHP and MySQL
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- Table of Contents
- Preface
- Audience
- Assumptions This Book Makes
- Organization of This Book
- Supporting Books
- Conventions Used in This Book
- Using Code Examples
- Safari® Enabled
- How to Contact Us
- Acknowledgments
- Dynamic Content and the Web
- PHP and MySQL's Place in Web Development
- Advantages of Using PHP with MySQL
- The Value of Open Source
- The Components of a PHP Application
- Birth of PHP
- Birth of Apache
- Apache Versions
- Birth of MySQL
- Compatibility
- Integrating Many Sources of Information
- MySQL Database
- PHP Templates
- Cascading Style Sheets
- HTML Markup
- Requesting Data from a Web Page
- PHP Interpretation on the Server
- Chap ter 1 Questions
- Installation
- Developing Locally
- Installing Apache
- Installing PHP
- Installing MySQL 4.1
- Working Remotely
- Chap ter 2 Questions
- Exploring PHP
- PHP and HTML Text
- Text Output
- Separating PHP from HTML
- Coding Building Blocks
- Variables
- Reading a variable's value
- Variable types
- Variable scope
- Strings
- Special characters in strings
- Comparing strings
- Concatenation
- Combining strings with other types
- Constants
- Predefined constants
- Doing Math
- Combined assignment
- Autoincrement and autodecrement
- Pre-increment and -decrement
- Chap ter 3 Questions
- PHP Decision Making
- Expressions
- Operator Concepts
- Number of Operands
- Types of Operands
- Order of precedence
- Associativity
- Relational Operators
- Equality
- Comparison operators
- Logical operators
- Conditionals
- The if Statement
- The else statement
- The elseif statement
- The ? Operator
- The switch Statement
- Breaking out
- Defaulting
- Looping
- while Loops
- do . . . while Loops
- for Loops
- Breaking Out of a Loop
- continue Statements
- Chap ter 4 Questions
- Functions
- Calling Functions
- Defining Functions
- Parameters
- Parameter References
- Including and Requiring PHP Files
- The include Statement
- The include_once statement
- require and require_once functions
- Testing a Function
- Object-Oriented Programming
- Creating a Class
- Creating an Instance
- Methods and Constructors
- Variable Scope Within Classes
- Inheritance
- The extends operator
- The parent operator
- Static Methods and Variables
- The :: operator (scope resolution)
- Variable References
- Chap ter 5 Questions
- Arrays
- Array Fundamentals
- Associative Versus Numeric Indexed Arrays
- Creating an Array
- Assignment via array identifiers
- Assignment using array
- Looping through and referencing array values
- Adding values to an array
- Counting how many elements are in an array
- Sorting arrays
- Multidimensional Arrays
- Extracting Variables from an Array
- Using compact to build an array from variables
- Array Functions in PHP
- Chap ter 6 Questions
- Database Basics
- Database Design
- Relational Databases
- Relationship Types
- One-to-one relationships
- One-to-many relationships
- Many-to-many relationships
- Normalization
- Forms of Normalization
- First Normal Form
- Second Normal Form
- Third Normal Form
- Column Data Types
- Structured Query Language
- Creating Tables
- Adding Data to a Table
- Querying the Database
- Limit results with WHERE
- Specifying the order
- Joining tables together
- Natural joins
- Aliases
- Modifying Database Data
- Deleting Database Data
- Search Functions
- Logical Operators
- Chap ter 7 Questions
- Using MySQL
- MySQL Database
- Accessing the Database with the Command Line
- Prompts
- Commands
- Managing the Database
- Creating Users
- Creating a MySQL Database
- Table Manipulation
- Renaming a table
- Changing a column's data type
- Adding a column
- Remove a column
- Deleting an entire table
- Using phpMyAdmin
- Backing Up and Restoring Data
- Copying Database Files
- The mysqldump Command
- Backing up
- Restoring a MySQL backup
- Working with other formats
- The mysqlimport command
- Backup best practices
- Advanced SQL
- Indexes
- When indexes are used
- Where to specify the index
- Multicolumn indexes
- Selecting Using the LEFT JOIN ON Clause
- Using Database Functions
- String functions
- Date and time functions
- Chap ter 8 Questions
- Getting PHP to Talk to MySQL
- The Process
- Resources
- Querying the Database with PHP Functions
- Including Database Login Details
- Connecting to the Database
- Troubleshooting connection errors
- Selecting the Database
- Building the SQL SELECT Query
- Executing the Query
- Fetching and Displaying
- Fetch types
- Closing the Connection
- Putting It All Together
- Using PEAR
- Installing
- Unix
- Windows
- Hosted ISP
- Adding Additional Packages
- Rewriting the Books Example with PEAR
- Creating a connect instance
- Connect string
- Querying
- Fetching
- Closing
- PEAR error reporting
- Chap ter 9 Questions
- Working with Forms
- Building a Form
- Accessing Submitted Form Values
- Default Values
- Types of Input
- Text boxes
- Text areas
- Checkboxes
- Radio buttons
- Hidden
- Selects
- Working with Multiple Values
- Validating Data
- Validating checkboxes, radio buttons, and selects
- Validating text boxes and text areas
- Building a Feet-to-Meters Converter in PHP
- Building a Time Zone Conversion Utility in PHP
- Querying the Database with Form Data
- Templates
- Template Engine
- Installation
- Application level directories
- Creating sample scripts
- Create a sample template
- Chap ter 10 Questions
- Practical PHP
- String Functions
- Formatting Strings for Display
- Using printf
- Padding
- Specifying precision
- Using sprintf
- Length
- Changing Case
- Checking for a String
- Using String Position and Substring to Extract a Portion of a String
- Date and Time Functions
- Display Formats
- Arithmetic
- Validating Dates
- Using mktime to Create a Timestamp
- File Manipulation
- Functions and Precautions
- Permissions
- Creating files
- Deleting files
- Moving files
- URL Wrappers
- Uploading Files
- Accessing the file
- Validation
- Calling System Calls
- Chap ter 11 Questions
- Modifying MySQL Objects and PHP Data
- Changing Database Objects from PHP
- Creating a Table
- Dropping a Table
- Errors Happen
- Manipulating Table Data
- Adding Data
- Displaying Results with Embedded Links
- Presenting a Form to Add and Process in One File
- SQL Injection
- Cross-Site Scripting Attacks
- Updating Data
- Deleting Data
- Generating Unique Identifiers
- Performing a Subquery
- Chap ter 12 Questions
- Cookies, Sessions, and Access Control
- Cookies
- Setting a Cookie
- Accessing a Cookie
- Destroying a Cookie
- PHP and HTTP Authentication
- Storing a Username and Password in a Database
- Sessions
- Using Sessions
- Expanding Our Login Example
- Ending a Session
- Garbage collection
- Setting a session's timeout
- Using Auth_HTTP to Authenticate
- Chap ter 13 Questions
- Security
- Limit Access to Administrative Pages
- Including Files
- Storing Passwords in the Database
- The Problem with Automatic Global Variables
- Session Security
- Session Hijacking and Session Fixation
- Trusting User Data
- Shared Hosting Concerns
- Preventing Access to the Database
- Blocking Access to the Database for External Hosts
- Create Separate Database Users
- Magic Quotes
- Chap ter 14 Questions
- Validation and Error Handling
- Validating User Input with JavaScript
- Pattern Matching
- Quantifiers
- Anchors
- Character classes
- Executing pattern matches in PHP
- preg_match
- Redisplaying a Form After PHP Validation Fails
- Chap ter 15 Questions
- Sample Applications
- Building a Blog
- Configuration File
- Page Framework
- Database
- Sample data
- Displaying a Postings Summary
- Displaying a Posting and Its Comments
- Adding and Changing Posts
- Adding and Changing Comments
- Chap ter 16 Questions
- Finishing Your Journey
- Finding Help on the Web
- Comments
- Formatting
- Indenting
- PHP tags
- Templating
- Expressions
- Function calls
- Function definitions
- Objects
- Naming
- Control Structures
- Including or requiring PHP files
- Web Sites
- Chat and Listservs for PHP
- PHP User Groups
- Zend
- Lampshade
- Chap ter 17 Questions
- Answers to Chapter Questions
- Chap ter 1
- Chap ter 2
- Chap ter 3
- Chap ter 4
- Chap ter 5
- Chap ter 6
- Chap ter 7
- Chap ter 8
- Chap ter 9
- Chap ter 10
- Chap ter 11
- Chap ter 12
- Chap ter 13
- Chap ter 14
- Chap ter 15
- Chap ter 16
- Chap ter 17
- Index
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.