13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

xviii<br />

Contents<br />

Looking at the Database with SHOW <strong>and</strong><br />

DESCRIBE 233<br />

Creating Indexes 234<br />

Underst<strong>and</strong>ing <strong>MySQL</strong> Identifiers 235<br />

Choosing Column Data Types 236<br />

Numeric Types 236<br />

Date <strong>and</strong> Time Types 238<br />

String Types 239<br />

Further Reading 241<br />

Next 241<br />

10 Working with Your <strong>MySQL</strong> Database 243<br />

What Is SQL? 243<br />

Inserting Data into the Database 244<br />

Retrieving Data from the Database 246<br />

Retrieving Data with Specific Criteria 248<br />

Retrieving Data from Multiple Tables 249<br />

Retrieving Data in a Particular Order 255<br />

Grouping <strong>and</strong> Aggregating Data 256<br />

Choosing Which Rows to Return 258<br />

Using Subqueries 258<br />

Updating Records in the Database 261<br />

Altering Tables After Creation 261<br />

Deleting Records from the Database 264<br />

Dropping Tables 264<br />

Dropping a Whole Database 264<br />

Further Reading 265<br />

Next 265<br />

11 Accessing Your <strong>MySQL</strong> Database from the<br />

<strong>Web</strong> with <strong>PHP</strong> 267<br />

How <strong>Web</strong> Database Architectures Work 268<br />

Querying a Database from the <strong>Web</strong> 271<br />

Checking <strong>and</strong> Filtering Input Data 271<br />

Setting Up a Connection 272<br />

Choosing a Database to Use 274

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!