Build Your Own Database Driven Website Using PHP and MySQL

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This book was great! It helped step through the basic and not so basic aspects of mysql and how it relates to php. The examples were easy to follow, but not condescending. It was helpful to have online access to the code. I really enjoyed the fact that he would give you enough information to understand the concept, but then had you figure things out on your own before giving the rest of the program. I have been impressed at the detail and helpfulness of this book.

Author(s): Kevin Yank
Edition: 3rd
Publisher: SitePoint
Year: 2004

Language: English
Pages: 382

Build Your Own Database Driven Website Using PHP & MySQL
......Page 1
Summary of Contents
......Page 2
Title Page
......Page 4
Table of Contents......Page 10
Preface......Page 16
What’s In This Book......Page 17
Updates and Errata......Page 20
Your Feedback......Page 21
Installation......Page 22
Installing MySQL......Page 23
Installing PHP......Page 25
Linux Installation......Page 31
Removing Packaged Software......Page 32
Installing MySQL......Page 33
Installing PHP......Page 36
Installing MySQL......Page 39
Installing PHP......Page 41
Post-Installation Setup Tasks......Page 42
If Your Web Host Provides PHP and MySQL......Page 44
Your First PHP Script......Page 46
Summary......Page 48
An Introduction to Databases......Page 50
Logging On to MySQL......Page 52
Creating a Database......Page 55
Creating a Table......Page 56
Inserting Data into a Table......Page 58
Viewing Stored Data......Page 59
Modifying Stored Data......Page 61
Summary......Page 62
Introducing PHP......Page 64
Basic Syntax and Commands......Page 66
Variables and Operators......Page 68
Arrays......Page 69
User Interaction and Forms......Page 71
Control Structures......Page 77
Multipurpose Pages......Page 82
Summary......Page 87
A Look Back at First Principles......Page 88
Connecting to MySQL with PHP......Page 90
Sending SQL Queries with PHP......Page 92
Handling SELECT Result Sets......Page 93
Inserting Data into the Database......Page 96
“Homework” Solution......Page 101
Giving Credit where Credit is Due......Page 106
Rule of Thumb: Keep Things Separate......Page 108
Dealing with Multiple Tables......Page 111
Simple Relationships......Page 115
Many-to-Many Relationships......Page 117
Summary......Page 120
A Content Management System......Page 122
The Front Page......Page 123
Managing Authors......Page 126
Deleting Authors......Page 128
Adding Authors......Page 132
Editing Authors......Page 133
Magic Quotes......Page 137
Managing Categories......Page 139
Managing Jokes......Page 144
Searching for Jokes......Page 145
Adding Jokes......Page 151
Editing and Deleting Jokes......Page 159
Summary......Page 164
Content Formatting and Submission......Page 166
Out with the Old......Page 167
Regular Expressions......Page 168
String Replacement with Regular Expressions......Page 171
Paragraphs......Page 172
Hyperlinks......Page 173
Matching Tags......Page 175
Splitting Text into Pages......Page 178
Putting it all Together......Page 180
Automatic Content Submission......Page 185
Summary......Page 186
MySQL Administration......Page 188
Backing up MySQL Databases......Page 189
Database Backups using mysqldump......Page 190
Incremental Backups using Update Logs......Page 191
Using GRANT......Page 193
Using REVOKE......Page 196
Access Control Tips......Page 197
Locked Out?......Page 199
Checking and Repairing MySQL Data Files......Page 200
Summary......Page 203
Sorting SELECT Query Results......Page 206
Setting LIMITs......Page 209
LOCKing TABLES......Page 210
Column and Table Name Aliases......Page 212
GROUPing SELECT Results......Page 215
LEFT JOINs......Page 217
Limiting Results with HAVING......Page 220
Summary......Page 221
Semi-Dynamic Pages......Page 222
Handling File Uploads......Page 227
Assigning Unique File Names......Page 229
Recording Uploaded Files in the Database......Page 231
Binary Column Types......Page 232
Storing Files......Page 233
Viewing Stored Files......Page 235
The Complete Script......Page 238
Summary......Page 243
Cookies......Page 244
PHP Sessions......Page 248
A Simple Shopping Cart......Page 251
Summary......Page 257
What is Structured Code?......Page 258
The Need for Structured Code......Page 259
Include Files......Page 261
Types of Includes......Page 265
Including HTML Content......Page 267
Locating Include Files......Page 269
Returning from Includes......Page 272
Custom Functions and Function Libraries......Page 276
Variable Scope and Global Access......Page 280
Optional and Unlimited Arguments......Page 284
Constants......Page 286
Structure In Practice: Access Control......Page 288
Summary......Page 297
ALTER TABLE......Page 300
CREATE DATABASE......Page 303
CREATE TABLE......Page 304
DELETE......Page 306
DROP DATABASE......Page 307
EXPLAIN......Page 308
INSERT......Page 309
LOAD DATA INFILE......Page 310
LOCK/UNLOCK TABLES......Page 311
RENAME TABLE......Page 312
REVOKE......Page 313
SELECT......Page 314
Joins......Page 318
SET......Page 320
SHOW......Page 321
UPDATE......Page 322
USE......Page 323
Mathematical Functions......Page 324
String Functions......Page 328
Date and Time Functions......Page 332
Miscellaneous Functions......Page 338
Functions for Use with GROUP BY Clauses......Page 341
Appendix C: MySQL Column Types......Page 344
Numerical Types......Page 345
Character Types......Page 347
Date/Time Types......Page 350
mysql_client_encoding......Page 354
mysql_connect......Page 355
mysql_db_query......Page 356
mysql_escape_string......Page 357
mysql_fetch_field......Page 358
mysql_fetch_object......Page 359
mysql_field_seek......Page 360
mysql_get_client_info......Page 361
mysql_insert_id......Page 362
mysql_list_tables......Page 363
mysql_ping......Page 364
mysql_result......Page 365
mysql_unbuffered_query......Page 366
Index......Page 368