Product Overview

Build Your Own Database Driven Website Using PHP & MySQL

Index Listing

Symbols

!
negation operator in PHP, Multipurpose Pages, Connecting to MySQL with PHP
!=
inequality operator in PHP, Control Structures
""
around strings in PHP, Variables and Operators
$_COOKIE, Cookies
$_FILES, Handling File Uploads, Storing Files
$_GET, User Interaction and Forms
$_POST, User Interaction and Forms
$_REQUEST, User Interaction and Forms
$_SERVER
HTTP_USER_AGENT, Viewing Stored Files
$_SESSION, PHP Sessions
%
modulus operator in MySQL, Mathematical Functions
wildcard for LIKE operator, Viewing Stored Data
&& (see and operator)
''
around strings in PHP, Basic Syntax and Commands, Variables and Operators
()
calling PHP functions, Basic Syntax and Commands
in regular expressions, Regular Expressions
*
in regular expressions, Regular Expressions
multiplication operator in PHP, Variables and Operators
+
addition operator in PHP, Variables and Operators
in regular expressions, Regular Expressions
-
subtraction operator in PHP, Variables and Operators
.
concatenation operator in PHP, Variables and Operators
in regular expressions, Regular Expressions
.=
string concatenation operator in PHP, Searching for Jokes
.cnf files, Installing MySQL
.htaccess
protecting directories with, A Content Management System
/
division operator in PHP, Variables and Operators
/* */
comments in PHP, Variables and Operators
//
comments in PHP, Variables and Operators
;
on the MySQL command line, Logging On to MySQL
terminating PHP statements, Basic Syntax and Commands
<
<=
less than or equal in PHP, Control Structures
less than in PHP, Control Structures
<?= ?>
PHP expression delimiters, Multipurpose Pages
<?php ?>
PHP code delimiters, Introducing PHP, Multipurpose Pages
=
assignment operator in PHP, Variables and Operators
==
equal-to operator in PHP, Control Structures
>
>=
greater than or equal in PHP, Control Structures
greater than in PHP, Control Structures
?
in regular expressions, Regular Expressions
@
error suppression operator in PHP, Connecting to MySQL with PHP
\c
on the MySQL command line, Logging On to MySQL
\n
line feed character in PHP, Searching for Jokes
\r
carriage return character in PHP, Searching for Jokes
\t
tab character in PHP, Searching for Jokes
|| (see or operator)

A

adding CMS items with PHP, Adding Authors
addslashes, Magic Quotes
and mysql_escape_string, mysql_escape_string
aliases
for columns and tables, Column and Table Name Aliases-Column and Table Name Aliases
ALTER TABLE, Giving Credit where Credit is Due, Rule of Thumb: Keep Things Separate, ALTER TABLE
ANALYZE TABLE, ANALYZE TABLE
and operator, Control Structures
Apache 2.0
compatibility with PHP, Installing PHP
array
PHP function, Arrays, Adding Jokes, A Simple Shopping Cart
arrays, Arrays
associative, Arrays
indices, Arrays
looping through elements, Adding Jokes-Adding Jokes
processing when submitted, Adding Jokes
submitting in a form, Adding Jokes
AUTO_INCREMENT, Creating a Table
obtaining last assigned value, Adding Jokes

B

BINARY, MySQL Column Types
BLOB types, Binary Column Types

C

cancelling a query, Logging On to MySQL
case sensitivity
in SQL queries, Creating a Table
categories
assigning to CMS items with PHP, Managing Jokes
database design for, Many-to-Many Relationships
managing with PHP, Managing Categories
character entities, Editing Authors
code archive, The Code Archive
columns, An Introduction to Databases, Index
(see also fields)
setting data types, Creating a Table
command prompt
in Windows, Installing MySQL
commands
MySQL (see queries)
comments, Variables and Operators
concurrent database operations, LOCKing TABLES
connecting
to MySQL with PHP, Connecting to MySQL with PHP
connection identifiers, Connecting to MySQL with PHP
content management systems, A Content Management System
content submissions
accepting from visitors, Automatic Content Submission
control structures, Control Structures
cookies, Cookies-Cookies
browser-enforced limits, Cookies
deleting, Cookies
saving after browser sessions, Cookies
setting, Cookies
copy, Semi-Dynamic Pages
count
PHP function, Adding Jokes, Splitting Text into Pages, A Simple Shopping Cart
CREATE DATABASE, Creating a Database, CREATE DATABASE
alternative to mysql_create_db, mysql_create_db
CREATE INDEX, CREATE INDEX
(see also ALTER TABLE)
CREATE TABLE, Creating a Table, Binary Column Types, CREATE TABLE
cron, Incremental Backups using Update Logs, Semi-Dynamic Pages
CURDATE, Inserting Data into the Database

D

data relationships, Simple Data Relationships
many-to-many, Many-to-Many Relationships
many-to-one, Simple Data Relationships
one-to-many, Simple Data Relationships
one-to-one, Simple Data Relationships
database anomalies
delete anomalies, Rule of Thumb: Keep Things Separate
update anomalies, Rule of Thumb: Keep Things Separate
database server, An Introduction to Databases
databases, An Introduction to Databases
creating, Creating a Database
designing, Relational Database Design
listing, Logging On to MySQL
mysql database, Logging On to MySQL
storing content in, An Introduction to Databases, A Look Back at First Principles
using, Creating a Database
DELETE, Deleting Stored Data, Deleting Authors, DELETE
rows affected by, Sending SQL Queries with PHP
deleting CMS items with PHP, “Homework” Solution, Deleting Authors
DESCRIBE, Creating a Table, Giving Credit where Credit is Due, DESCRIBE
die, Connecting to MySQL with PHP
DROP DATABASE, Logging On to MySQL, DROP DATABASE
DROP INDEX, DROP INDEX
(see also ALTER TABLE)
DROP TABLE, Creating a Table, DROP TABLE

E

echo, Basic Syntax and Commands
editing CMS items with PHP, Editing Authors
else statements (see if-else statements)
email
sending with PHP, Email in PHP-Email in PHP
enctype
attribute of form tags, Handling File Uploads
ereg, Regular Expressions
ereg_replace, String Replacement with Regular Expressions
eregi, Regular Expressions
eregi_replace, String Replacement with Regular Expressions
escaping special characters, Magic Quotes, Hyperlinks
in regular expressions, Regular Expressions, Boldface and Italic Text, Hyperlinks
exit
in PHP, Connecting to MySQL with PHP
on the MySQL command line, Logging On to MySQL
EXPLAIN, EXPLAIN
explode, Splitting Text into Pages

F

fclose, Semi-Dynamic Pages
fields, An Introduction to Databases, Index
(see also columns)
files
accessing with PHP, Semi-Dynamic Pages
storing in MySQL, Storing Files
flow of control (see control structures)
fopen, Semi-Dynamic Pages
for loops, Control Structures, A Simple Shopping Cart
forced rows, LEFT JOINs
foreach loops, Adding Jokes
formatting content, Content Formatting and Submission
forms
submission methods, User Interaction and Forms
fread, Semi-Dynamic Pages
functions, Basic Syntax and Commands
(see also PHP, built-in functions)
parameters, Basic Syntax and Commands
return values, Connecting to MySQL with PHP
fwrite, Semi-Dynamic Pages

G

GRANT, Using GRANT, GRANT
examples of use, Using GRANT
group-by functions (see summary functions)

H

header, Viewing Stored Files, The Complete Script
(see also HTTP headers)
HTML
stripping out of content, Out with the Old
htmlspecialchars, Managing Authors, Editing Authors, Out with the Old
HTTP headers, Viewing Stored Files
content-disposition, Viewing Stored Files
content-length, Viewing Stored Files
content-type, Viewing Stored Files
cookie, Cookies
location, The Complete Script
set-cookie, Cookies

I

ID columns, An Introduction to Databases, Creating a Table, Index
(see also primary keys)
if-else statements, Control Structures
include, Server-Side Includes with PHP, Increasing Security with Includes
InnoDB tables, LOCKing TABLES
INSERT, Inserting Data into a Table, Adding Authors, INSERT, REPLACE
(see also REPLACE)
and TIMESTAMP columns, Date/Time Types
IGNORE, Adding Jokes
rows affected by, Sending SQL Queries with PHP
is_uploaded_file, Assigning Unique File Names, Storing Files

J

joins, Dealing with Multiple Tables, Joins
inner joins, Joins
left joins, LEFT JOINs-LEFT JOINs, Joins
(see also outer joins)
natural joins, Joins
outer joins, Joins

L

line breaks
platform-specific issues, Paragraphs
LOAD DATA INFILE, LOAD DATA INFILE
LOCK TABLES, LOCKing TABLES, LOCK/UNLOCK TABLES
look-up tables, Many-to-Many Relationships
queries using, Many-to-Many Relationships

M

magic quotes, Magic Quotes
and mysql_escape_string, mysql_escape_string
mail, Email in PHP
MAX_FILE_SIZE
hidden form field, Handling File Uploads
my.cnf, Installing MySQL, Installing MySQL
max_allowed_packet, MySQL Packet Size
my.ini (see my.cnf)
myisamchk, Checking and Repairing MySQL Data Files
MySQL, Who Should Read This Book, Welcome to the Show
administration, MySQL Administration
assigning a root password, Post-Installation Setup Tasks
backing up data, Standard Backups Aren't Enough, Incremental Backups using Update Logs
(see also update logs)
command-line client, Logging On to MySQL
controlling access to, MySQL Access Control
tips, Access Control Tips
data files, Checking and Repairing MySQL Data Files
getting started with, Getting Started with MySQL
installing
in Linux, Installing MySQL
in Windows, Installing MySQL
killing server process, Locked Out?
logging on to, Logging On to MySQL
lost password recovery, Locked Out?
password, Logging On to MySQL
removing packaged versions, Linux Installation
repairing corrupt data files, Checking and Repairing MySQL Data Files
tips, Checking and Repairing MySQL Data Files
restoring backed up data, Database Backups using mysqldump, Incremental Backups using Update Logs
running automatically at start-up, Installing MySQL, Installing MySQL
transaction support, LOCKing TABLES
user name, Logging On to MySQL
MySQL column types, MySQL Column Types
BIGINT, Numerical Types
BLOB, Character Types
CHAR, Character Types
DATE, Date/Time Types
DATETIME, Date/Time Types
DECIMAL, Numerical Types
DOUBLE, Numerical Types
ENUM, Automatic Content Submission, Character Types
FLOAT, Numerical Types
for binary data, Binary Column Types
INT, Creating a Table, Numerical Types
LONGBLOB, Character Types
LONGTEXT, Character Types
MEDIUMBLOB, Character Types
MEDIUMINT, Numerical Types
MEDIUMTEXT, Character Types
SET, Character Types
SMALLINT, Numerical Types
TEXT, Creating a Table, Character Types
TEXT vs. BLOB types, Binary Column Types
TIME, Date/Time Types
TIMESTAMP, Date/Time Types
TINYBLOB, Character Types
TINYINT, Numerical Types
TINYTEXT, Character Types
VARCHAR, Character Types
YEAR, Date/Time Types
MySQL functions, MySQL Functions
ABS, Mathematical Functions
ACOS, Mathematical Functions
ADDDATE, Date and Time Functions
ASCII, String Functions
ASIN, Mathematical Functions
ATAN, Mathematical Functions
ATAN2, Mathematical Functions
AVG, Functions for Use with GROUP BY Clauses
BENCHMARK, Miscellaneous Functions
BIN, String Functions
BIT_AND, Functions for Use with GROUP BY Clauses
BIT_LENGTH, String Functions
BIT_OR, Functions for Use with GROUP BY Clauses
CASE, Control Flow Functions
CEILING, Mathematical Functions
CHAR, String Functions
CHAR_LENGTH, String Functions
CHARACTER_LENGTH, String Functions
CONCAT, String Functions
CONCAT_WS, String Functions
CONNECTION_ID, Miscellaneous Functions
CONV, String Functions
COS, Mathematical Functions
COT, Mathematical Functions
COUNT, Viewing Stored Data, GROUPing SELECT Results, Functions for Use with GROUP BY Clauses
omitting NULLs, LEFT JOINs
CURDATE, Date and Time Functions
CURRENT_DATE, Date and Time Functions
CURRENT_TIME, Date and Time Functions
CURRENT_TIMESTAMP, Date and Time Functions
CURTIME, Date and Time Functions
DATABASE, Miscellaneous Functions
DATE_ADD, Date and Time Functions
DATE_FORMAT, Date and Time Functions
DATE_SUB, Date and Time Functions
DAYNAME, Date and Time Functions
DAYOFMONTH, Date and Time Functions
DAYOFWEEK, Date and Time Functions
DAYOFYEAR, Date and Time Functions
DECODE, Miscellaneous Functions
DEGREES, Mathematical Functions
ELT, String Functions
ENCODE, Miscellaneous Functions
ENCRYPT, Miscellaneous Functions
EXP, Mathematical Functions
EXPORT_SET, String Functions
FIELD, String Functions
FIND_IN_SET, String Functions
FLOOR, Mathematical Functions
FORMAT, Miscellaneous Functions
FROM_DAYS, Date and Time Functions
FROM_UNIXTIME, Date and Time Functions
GET_LOCK, Miscellaneous Functions
GREATEST, Mathematical Functions
HEX, String Functions
HOUR, Date and Time Functions
IF, Control Flow Functions
IFNULL, Control Flow Functions
INET_ATON, Miscellaneous Functions
INET_NTOA, Miscellaneous Functions
INSERT, String Functions
INSTR, String Functions
LAST_INSERT_ID, Miscellaneous Functions
LCASE, String Functions
LEAST, Mathematical Functions
LEFT, Viewing Stored Data, String Functions
LENGTH, String Functions
LOAD_FILE, String Functions
LOCATE, String Functions
LOG, Mathematical Functions
LOG10, Mathematical Functions
LPAD, String Functions
LTRIM, String Functions
MAKE_SET, String Functions
MD5, Miscellaneous Functions
MID, String Functions
MIN, Functions for Use with GROUP BY Clauses
MINUTE, Date and Time Functions
MOD, Mathematical Functions
MONTH, Date and Time Functions
MONTHNAME, Date and Time Functions
NOW, Date and Time Functions
NULLIF, Control Flow Functions
OCT, String Functions
OCTET_LENGTH, String Functions
ORD, String Functions
PASSWORD, Miscellaneous Functions
PERIOD_ADD, Date and Time Functions
PERIOD_DIFF, Date and Time Functions
PI, Mathematical Functions
POSITION, String Functions
POW, Mathematical Functions
POWER, Mathematical Functions
QUARTER, Date and Time Functions
RADIANS, Mathematical Functions
RAND, Mathematical Functions
RELEASE_LOCK, Miscellaneous Functions
REPEAT, String Functions
REPLACE, String Functions
REVERSE, String Functions
RIGHT, String Functions
ROUND, Mathematical Functions
RPAD, String Functions
RTRIM, String Functions
SEC_TO_TIME, Date and Time Functions
SECOND, Date and Time Functions
SESSION_USER, Miscellaneous Functions
SIGN, Mathematical Functions
SIN, Mathematical Functions
SOUNDEX, String Functions
SPACE, String Functions
SQRT, Mathematical Functions
STD, Functions for Use with GROUP BY Clauses
STDDEV, Functions for Use with GROUP BY Clauses
SUBDATE, Date and Time Functions
SUBSTRING, String Functions
SUBSTRING_INDEX, String Functions
SUM, Functions for Use with GROUP BY Clauses
SYSDATE, Date and Time Functions
SYSTEM_USER, Miscellaneous Functions
TAN, Mathematical Functions
TIME_FORMAT, Date and Time Functions
TIME_TO_SEC, Date and Time Functions
TO_DAYS, Date and Time Functions
TRIM, String Functions
TRUNCATE, Mathematical Functions
UCASE, String Functions
UNIX_TIMESTAMP, Date and Time Functions
USER, Miscellaneous Functions
VERSION, Miscellaneous Functions
WEEK, Date and Time Functions
WEEKDAY, Date and Time Functions
YEAR, Date and Time Functions
YEARWEEK, Date and Time Functions
mysql.server, Installing MySQL
mysql_affected_rows, Sending SQL Queries with PHP, mysql_affected_rows, mysql_data_seek
mysql_close, mysql_close
mysql_connect, Connecting to MySQL with PHP, mysql_connect
mysql_create_db, mysql_create_db
mysql_db_name, mysql_db_name, mysql_list_fields
mysql_db_query, mysql_db_query
mysql_drop_db, mysql_drop_db
mysql_errno, mysql_errno
mysql_error, Sending SQL Queries with PHP, mysql_error
mysql_escape_string, mysql_escape_string
mysql_fetch_array, Handling SELECT Result Sets, mysql_fetch_array
mysql_fetch_assoc, mysql_fetch_assoc
mysql_fetch_field, mysql_fetch_field
mysql_fetch_lengths, mysql_fetch_lengths
mysql_fetch_object, mysql_fetch_object
mysql_fetch_row, mysql_fetch_row
mysql_field_flags, mysql_field_flags
mysql_field_len, mysql_field_len
mysql_field_name, mysql_field_name
mysql_field_seek, mysql_field_seek
mysql_field_table, mysql_field_table
mysql_field_type, mysql_field_type
mysql_free_result, mysql_free_result
mysql_get_client_info, mysql_get_client_info
mysql_get_host_info, mysql_get_host_info
mysql_get_proto_info, mysql_get_proto_info
mysql_get_server_info, mysql_get_server_info
mysql_insert_id, Adding Jokes, INSERT, mysql_insert_id
mysql_list_dbs, mysql_list_dbs
mysql_list_tables, mysql_list_tables
mysql_num_fields, mysql_num_fields
mysql_num_rows, mysql_num_rows
mysql_pconnect, mysql_pconnect
mysql_query, Sending SQL Queries with PHP, mysql_query
using result sets from, Handling SELECT Result Sets
mysql_result, mysql_result
mysql_select_db, Connecting to MySQL with PHP, mysql_select_db
mysql_tablename, mysql_tablename
mysql_unbuffered_query, mysql_unbuffered_query
mysqld.exe
choosing MySQL server version, Installing MySQL
mysqldump, Database Backups using mysqldump

N

NOT NULL, Creating a Table, Automatic Content Submission
number_format, A Simple Shopping Cart

O

operators, Variables and Operators
(see also individual entries for operators)
arithmetic, Variables and Operators
concatenation, Variables and Operators
OPTIMIZE TABLE, OPTIMIZE TABLE
or operator, Control Structures

P

PHP, Who Should Read This Book, Welcome to the Show
basic syntax, Basic Syntax and Commands
built-in functions, Basic Syntax and Commands
getting started with, Getting Started with PHP
installing
in Linux, Installing PHP
in Windows, Installing PHP
with Apache for Windows, Installing PHP
with IIS, Installing PHP
removing packaged versions, Linux Installation
php.ini, Installing PHP, Installing PHP
and Mac OS X, Post-Installation Setup Tasks
email settings, Email in PHP
include_path, Increasing Security with Includes
post_max_size, Handling File Uploads
session setup, PHP Sessions
upload_max_filesize, Handling File Uploads
upload_tmp_dir, Handling File Uploads
phpMyAdmin, Logging On to MySQL
PRIMARY KEY, Creating a Table
primary keys, Many-to-Many Relationships
multi-column, Many-to-Many Relationships

Q

queries, So what's SQL?
cancelling, Logging On to MySQL
case sensitivity, Creating a Table
query string, User Interaction and Forms
quit
on the MySQL command line, Logging On to MySQL

R

referential integrity
in MySQL, Deleting Authors
register_globals, User Interaction and Forms
regular expressions, Regular Expressions
capturing matched text, Hyperlinks
string replacement with, String Replacement with Regular Expressions
relationships (see data relationships)
RENAME TABLE, RENAME TABLE
(see also ALTER TABLE)
REPLACE, REPLACE
result sets, Handling SELECT Result Sets
REVOKE, Using REVOKE, REVOKE
examples of use, Using REVOKE
rows, An Introduction to Databases
counting
in MySQL, Viewing Stored Data
deleting, Deleting Stored Data
updating, Modifying Stored Data

S

search engines, Searching for Jokes
SELECT, Viewing Stored Data, Managing Authors, SELECT-Joins, Joins
aliases in, Column and Table Name Aliases
building dynamically with PHP, Searching for Jokes
GROUP BY clause, GROUPing SELECT Results, SELECT
grouping results, GROUPing SELECT Results-GROUPing SELECT Results
HAVING clause, Limiting Results with HAVING, SELECT
INTO clause, SELECT
LEFT JOIN ... ON, LEFT JOINs
LIKE operator, Viewing Stored Data, Searching for Jokes
LIMIT clause, Setting LIMITs
limiting number of results, Setting LIMITs
ORDER BY clause, Sorting SELECT Query Results, SELECT
SELECT DISTINCT, Rule of Thumb: Keep Things Separate
sorting results, Sorting SELECT Query Results
WHERE clause, Viewing Stored Data, SELECT
with multiple tables, Dealing with Multiple Tables
semi-dynamic pages, Semi-Dynamic Pages-Semi-Dynamic Pages
server side includes
increasing security with, Increasing Security with Includes
server-side includes, Server-Side Includes with PHP
server-side languages, Introducing PHP
advantages of, Introducing PHP
compared to JavaScript, Introducing PHP
session_destroy, PHP Sessions
session_start, PHP Sessions
sessions, PHP Sessions-PHP Sessions
SET, SET
setcookie, Cookies
short-circuit evaluation, Assigning Unique File Names
SHOW, SHOW
SHOW DATABASES, Logging On to MySQL
SHOW TABLES, Creating a Table
special characters, Editing Authors, Index
(see also escaping special characters)
split, Splitting Text into Pages
spliti, Splitting Text into Pages
SQL (see Structured Query Language)
statements, Basic Syntax and Commands
str_replace, Matching Tags
stripslashes, Magic Quotes
strlen, Viewing Stored Files
strpos, Viewing Stored Files
Structured Query Language, Who Should Read This Book, So what's SQL?
sub-selects, CREATE TABLE
summary functions, GROUPing SELECT Results, Functions for Use with GROUP BY Clauses
(see also MySQL functions)

T

tables, An Introduction to Databases
counting number of entries, Viewing Stored Data
creating, Creating a Table
deleting, Creating a Table
deleting entries, Deleting Stored Data
inserting data, Inserting Data into a Table
listing, Creating a Table
locking, LOCKing TABLES
relationships between, Rule of Thumb: Keep Things Separate
separating data with, Rule of Thumb: Keep Things Separate
structural overview, An Introduction to Databases
temporary, CREATE TABLE
updating entries, Modifying Stored Data
viewing entries, Viewing Stored Data
task scheduler, Incremental Backups using Update Logs, Semi-Dynamic Pages
time, Cookies
transactions, LOCKing TABLES

U

unlink, Semi-Dynamic Pages
UNLOCK TABLES, LOCKing TABLES, LOCK/UNLOCK TABLES
unset, A Simple Shopping Cart
UNSIGNED, MySQL Column Types
UPDATE, Modifying Stored Data, Editing Authors, UPDATE
and TIMESTAMP columns, Date/Time Types
rows affected by, Sending SQL Queries with PHP
WHERE clause, Modifying Stored Data
update logs, Incremental Backups using Update Logs
managing, Incremental Backups using Update Logs
uploading files, Handling File Uploads-Recording Uploaded Files in the Database, Recording Uploaded Files in the Database
with unique file names, Assigning Unique File Names
urlencode, Multipurpose Pages
USE, Creating a Database, USE

V

variables, Variables and Operators
interpolation in PHP strings, Variables and Operators

W

while loops, Control Structures, Adding Jokes

X

XHTML, User Interaction and Forms

Z

ZEROFILL, MySQL Column Types

Buy ANY SitePoint Book — Get A PDF FREE!

Pick any PDFThat's right, order ‘Build Your Own Database Driven Website Using PHP & MySQL’ TODAY and grab ANY PDF you like — FREE!

Choose your FREE PDF

3rd Edition

3rd Edition NOW Available!

What's New?

  • All-new coverage of PHP 5.0 keeps up to date with the latest best practices in PHP
  • New screenshots throughout the book show you how it’s done visually
  • A new chapter on building structured programming that teaches you to build an access control system in PHP
  • Revised and expanded throughout
  • All known errors in the previous edition now corrected
  • 58 pages longer

» Click here to order!

SitePoint Books

  • Advocate best practice techniques
  • Lead you through practical examples
  • Provide working code for your web site
  • Make learning easy and fun

100% Money Back Guarantee