100% found this document useful (5 votes)
34 views

(eBook PDF) Murach's PHP and MySQL (3rd Edition) by Joel Murachinstant download

Murach's PHP and MySQL (3rd Edition) is a comprehensive guide designed to teach readers how to develop PHP applications that interact with MySQL databases. The book covers essential topics such as working with form data, managing sessions and cookies, and implementing advanced web skills like security and file uploads. It also includes practical applications and examples to reinforce learning and mastery of PHP and MySQL programming.

Uploaded by

safennouras
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
34 views

(eBook PDF) Murach's PHP and MySQL (3rd Edition) by Joel Murachinstant download

Murach's PHP and MySQL (3rd Edition) is a comprehensive guide designed to teach readers how to develop PHP applications that interact with MySQL databases. The book covers essential topics such as working with form data, managing sessions and cookies, and implementing advanced web skills like security and file uploads. It also includes practical applications and examples to reinforce learning and mastery of PHP and MySQL programming.

Uploaded by

safennouras
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

(eBook PDF) Murach's PHP and MySQL (3rd Edition)

by Joel Murach pdf download

https://ebooksecure.com/product/ebook-pdf-murachs-php-and-
mysql-3rd-edition-by-joel-murach/

Download more ebook from https://ebooksecure.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebooksecure.com
to discover even more!

(eBook PDF) Murach's C++ Programming by Joel Murach

http://ebooksecure.com/product/ebook-pdf-murachs-c-programming-
by-joel-murach/

(eBook PDF) Murach's Java Programming 5th Edition by


Joel Murach

http://ebooksecure.com/product/ebook-pdf-murachs-java-
programming-5th-edition-by-joel-murach/

Progress in Heterocyclic Chemistry Volume 29 1st


Edition - eBook PDF

https://ebooksecure.com/download/progress-in-heterocyclic-
chemistry-ebook-pdf/

(eBook PDF) Translational Medicine in CNS Drug


Development, Volume 29

http://ebooksecure.com/product/ebook-pdf-translational-medicine-
in-cns-drug-development-volume-29/
Cardiology-An Integrated Approach (Human Organ Systems)
(Dec 29, 2017)_(007179154X)_(McGraw-Hill) 1st Edition
Elmoselhi - eBook PDF

https://ebooksecure.com/download/cardiology-an-integrated-
approach-human-organ-systems-dec-29-2017_007179154x_mcgraw-hill-
ebook-pdf/

Netter Atlas of Human Anatomy-Classic Regional


Approach, 8e (Mar 29, 2022)_(0323793738)_(Elsevier) NOT
TRUE PDF 8th Edition - eBook PDF

https://ebooksecure.com/download/netter-atlas-of-human-anatomy-
classic-regional-approach-8e-mar-29-2022_0323793738_elsevier-not-
true-pdf-ebook-pdf/

(eBook PDF) Criminal Procedure 10th Edition by Joel


Samaha

http://ebooksecure.com/product/ebook-pdf-criminal-procedure-10th-
edition-by-joel-samaha/

(eBook PDF) University Calculus: Early Transcendentals


4th Edition by Joel R. Hass

http://ebooksecure.com/product/ebook-pdf-university-calculus-
early-transcendentals-4th-edition-by-joel-r-hass/

Criminal law (Twelth Edition) Joel Samaha - eBook PDF

https://ebooksecure.com/download/criminal-law-twelth-edition-
ebook-pdf/
GET OFF TO A FAST START
by learning how to develop
PHP applications that get data from
MySQL databases ...in just 6 chapters!

MASTERPHP
as you learn how to work with form data,
dates, arrays, sessions, cookies, functions,
objects, and regular expressions

MASTER MySQL
as you learn how to design, create,
and query MySQL or MariaDB databases
and use PHP to work with them

MASTER ADVANCED WEB SKILLS


like how to secure a website, prevent
injection attacks, send email, upload files,
process images, and more

VI Expanded contents

How to code control statements .....................................................72


How to code conditional expressions ............................................................................ 72
How to code if statements ............................................................................................. 74
How to code while and for statements .......................................................................... 76
How to pass control to another page ............................................................................. 78
The Future Value application ...........................................................80
The user interface ............................................................................................................ 80
The code for the index.php file ..................................................................................... 82
The code for the display_results.php file ...................................................................... 84
How to use the PHP documentation ............................................... 88
How to access the PHP manual ........................................................................................ 88
How to find the documentation you need ..................................................................... 88

Chapter 3 Introduction to relational databases and MySQL


An introduction to relational databases ......................................... 96
How a database table is organized ................................................................................ 96
How the tables in a relational database are related ...................................................... 98
How the columns in a table are defined ...................................................................... 100
The SQL statements for data manipulation ................................. 102
How to select data from a single table ........................................................................ 102
How to select data from multiple tables ..................................................................... 104
How to insert, update, and delete data ........................................................................ 106
An introduction to MySQL ............................................................. 108
What MySQL provides .................................................................................................... 108
1wo ways to work with MySQL ................................................................................. 110
How to use phpMyAdmin ............................................................... 112
How to start phpMyAdmin ......................................................................................... 112
How to log in, log out, and change your password ..................................................... 112
How to import and run a SQL script that creates a database ..................................... 114
How to review the data and structure of a table ......................................................... 116
How to run SQL statements .......................................................................................... 118
How to create users with limited privileges ............................................................... 120

Chapter 4 How to use PHP with a MySQL database


How to connect to a database and handle exceptions ............... 126
How to connect to a database ..................................................................... ...................... 126
How to handle exceptions ............... .................................................................. .............. 128
How to get and modify data ........................................................... 130
How to execute SELECT statements .......................................................................... 130
How to work with the first row of a result set............................................................. 132
How to work with all the rows of a result set ............................................................. 134
How to execute INSERT, UPDATE, and DELETE statements ................................. 136
The Product Viewer application .................................................... 138
The user interface ......................................................................................................... 138
The code ....................................................................................................................... 140
The Product Manager application ................................................. 146
The user interface ....................................................................................................... 146
The code ................................................................................................................................. 148
••
Expanded contents VII

Chapter 5 How to use the MVC pattern to organize your code


How to use the MVC pattern .......................................................... 160
An introduction to the MVC pattern .......................................................................... 160
How to code functions ................................................................................................ 162
How to redirect requests ................................................................................................ 164
The Product Manager application ................................................. 166
The user interface .......................................................................................................... 166
The model ................................................................................................................... 168
The controller ................................................................................................................ 172
Theview .......................................................................................................................... 174
The Product Catalog application ................................................... 180
The user interface .......................................................................................................... 180
The model ................................................................................................................... 182
The controller ............................................................................................................................ 182
The view ............................................................................................................................ 184

Chapter 6 How to test and debug a PHP application


An introduction to testing and debugging ................................... 192
Typical test phases for a PHP application ................................................................... 192
The three types of errors that can occur ..................................................................... 192
Common PHP errors ..................................................................................................... 194
An easy way to trace the execution of your PHP code ............................................... 196
How to debug with Xdebug and NetBeans................................... 198
How to set and remove breakpoints ............................................................................ 198
How to step through code .............................................................................................. 200
How to inspect variables .................................................................................................. 200
How to inspect the stack trace ....................................................................................... 202

Section 2 Master PHP programming


Chapter 7 How to work with form data
How to get data from a form .......................................................... 210
How to get data from text boxes, password boxes, and hidden fields ........................ 210
How to get data from a radio button ........................................................................... 212
How to get data from a check box .............................................................................. 214
How to get data from an array of check boxes ........................................................... 216
How to get data from a drop-down list ....................................................................... 218
How to get data from a list box ........................................................................................ 220
How to get data from a text area ................................................................................. 222
How to display data on a web page ..............................................224
How to format special characters ............................................................................... 224
How to format line breaks ............................................................................................... 226
How to display data with echo and print statements .................................................. 228

Chapter 8 How to code control statements


How to code conditional expressions ..........................................234
How to use the equality and identity operators .......................................................... 234
How to use the relational operators ............................................................................ 236
How to use the logical operators ................................................................................. 238
•••
VIII Expanded contents

How to code the selection structures...........................................240


How to code if statements with else clauses ............................................................... 240
How to code if statements with else if clauses ........................................................... 242
How to use the conditional and null coalesce operators ............................................ 244
How to code switch statements ................................................................................... 246
How to use a switch statement in the controller ......................................................... 248
How to code the iteration structures ............................................250
How to code while loops ............................................................................................. 250
How to code do-while loops ................................................................................................. 252
How to code for loops ....................................................................................................... 254
How to use the break and continue statements ........................................................... 256

Chapter 9 How to work with strings and numbers


How to work with strings ...............................................................262
How to create strings ...................................................................................................................... 262
How to use escape sequences ............................................................................................. 264
How to work with string length and substrings .......................................................... 266
How to search a string ....................................................................................................................................... 268
How to replace part of a string .................................................................................................................. 268
How to modify str·ings .............................................................................................................. 270
How to convert strings to and from arrays ................................................................. 272
How to convert strings to and from ASCII values ..................................................... 272
How to compare strings ......................................................................................................... 274
How to work with numbers ............................................................276
How to assign integers ................................................................................................................................ 276
How to assign floating-point values ............................................................................ 278
How to use the math functions ................................................................................................ 280
How to generate random numbers .............................................................................. 282
Other skills for working with strings and numbers..................... 284
How to use the sprintf() function to format strings and numbers .............................. 284
How to convert strings to numbers ............................................................................. 288

Chapter 10 How to work with dates


How to use timestamps to work with dates ................................. 294
How to create and format timestamps ........................................................................ 294
How to work with timestamps ...................................................................................................... 296
How to use the strtotime() function ............................................................................ 298
Examples of working with timestamps ...................................................................... 300
How to use objects to work with dates .........................................302
How to use the DateTime class .................................................................................................... 302
How to use the Dateinterval class ............................................................................... 304
How to use the Dateinterval and DateTime classes together ..................................... 306
Examples of working with DateTime objects ............................................................. 308

Chapter 11 How to create and use arrays


How to create and use an array ..................................................... 314
How to create an ar·ray .................................................................................................................... 314
How to add and delete elements ................................................................................. 316
How to work with variable substitution ...................................................................... 316
How to use for loops to work with arrays ................................................................... 318
How to create and use an associative array ................................ 320
How to create an associative array ............................................................................. 320
How to add and delete elements ................................................................................. 322
How to work with variable substitution ...................................................................... 322
How to use foreach loops to work with arrays ........................................................... 324

Expanded contents IX

How to use functions to work with arrays .................................... 326


How to fill, merge, slice, and splice arrays ................................................................. 326
How to work with queues and stacks .......................................................................... 328
How to get the sum and product of elements .............................................................. 330
How to search arrays ................................................................................................... 330
How to sort arrays .......................................................................................................... 332
How to modify arrays ................................................................................................. 334
How to work with arrays of arrays .................................................336
Understanding an array of arrays ............................................................................... 336
How to create and use an array of arrays ................................................................... 338
The Task List Manager application ...............................................340
The user interface ....................................................................................................... 340
The code for the controller ............................................................................................ 340
The code for the view ................................................................................................. 342

Chapter 12 How to work with cookies and sessions


How to work with cookies ..............................................................350
An introduction to cookies ......................................................................................... 350
How to set and get a cookie ......................................................................................... 352
How to enable or disable cookies ............................................................................... 354
How to work with sessions ............................................................356
Why session tracking is difficult with HTTP ............................................................. 356
How session tracking works in PHP ........................................................................... 356
How to start a session ................................................................................................. 358
How to set and get session variables ........................................................................... 360
How to manage a session ............................................................................................ 362
How to end a session ................................................................................................... 364
The Shopping Cart application .....................................................366
The user interface ....................................................................................................... 366
The controller .............................................................................................................. 368
The model ..................................................................................................................... 370
The Add Item view ..................................................................................................... 372
The Cart view .............................................................................................................. 374

Chapter 13 How to create and use functions


Basic skills for working with functions ........................................382
How to create and call a function ............................................................................... 382
How to pass arguments by value and by reference ..................................................... 384
How variable scope works .......................................................................................... 386
How to provide default values for parameters ............................................................ 388
How to work with type declarations ........................................................................... 390
How to use variable-length parameter lists ................................................................ 392
How to create and use a library of functions ...............................394
A library of functions ................................................................................................. 394
How to set the include path ......................................................................................... 396
How function scope works .......................................................................................... 396
How to create and use namespaces ............................................................................. 398
Advanced skills for working with functions .................................400
How to work with variable functions and callbacks ................................................... 400
How to work with anonymous functions .................................................................... 402
How to work with closures ......................................................................................... 406
X Expanded contents

The Shopping Cart application .....................................................408


The user interface .......................................................................................................... 408
The model ................................................................................................................... 412
The controller ................................................................................................................. 413
The view ...................................................................................................................... 413

Chapter 14 How to create and use objects


How to create and use classes ...................................................... 418
The code for the Category class .................................................................................. 418
The code for the Product class .................................................................................... 420
How to code properties ................................................................................................ 424
How to code constructors and destructors .................................................................. 426
How to code methods ............................................................................................................... 428
How to create and use objects ........................................................................................... 430
How to code class constants, properties, and methods ............ 432
How to code class constants ......................................................................................... 432
How to code static properties and methods ................................................................ 434
The object-oriented Product Manager application .....................436
The user interface ............................................................................................................ 436
The model ................................................................................................................... 438
The controller ..................................................................................................................... 442
The view ........................................................................................................................ 4.44
Additional skills for working with objects ....................................446
How to loop through an object's properties ................................................................ 446
How to clone and compare objects ............................................................................. 448
How to inspect an obje.ct ............................................................................................. 450
How to work with inheritance ........................................................452
How to inherit a class ....................................................................................................... 452
How to use the protected access modifier .................................................................. 454
How to create abstract classes and methods ............................................................... 456
How to create final classes and methods .................................................................... 458
How to work with interfaces ....................................................................................... 460

Chapter 15 How to use regular expressions, handle exceptions,


and validate data
How to use regular expressions ...................................................466
How to create and use regular expressions ................................................................. 466
How to match characters .................................................................................................. 468
How to use the character class ..................................................................................... 470
How to create complex patterns ..................................................................................... 472
How to use look-ahead assertions ............................................................................... 474
How to use a multiline regular expression ................................................................. 476
How to use a global regular expression ...................................................................... 476
How to replace a regular expression with a string ...................................................... 478
How to split a string on a regular expression.............................................................. 478
Regular expressions for data validation ...................................................................... 480
Ho\lV to llc111cllt! E!>Ct:eJ)tio11!S ....•.....................••.....•....................•.•..... .i.11~
How to create and throw exceptions ........................................................................... 482
How to catch exceptions ............................................................................................. 484
How to catch errors .......................................................................................................... 486

Expanded contents XI

The Registration application .........................................................488


The user interface .......................................................................................................... 488
The file structure ......................................................................................................... 488
The model ....................................................................................................................... 490
The controller .............................................................................................................. 498
The view ........................................................................................................................ 500
A long version of the Registration application ........................................................... 502

Section 3 Master MySQL programming


Chapter 16 How to design a database
How to design a data structure ..................................................... 510
The basic steps for designing a data structure ............................................................ 510
How to identify the data elements .............................................................................. 512
How to subdivide the data elements ........................................................................... 514
How to identify the tables and assign columns .......................................................... 516
How to identify the primary and foreign keys ............................................................ 518
How to enforce the relationships between tables ....................................................... 520
How normalization works ............................................................................................. 522
How to identify the columns to be indexed ................................................................ 524
How to normalize a data structure ................................................526
The seven normal forms .............................................................................................. 526
How to apply the first normal form ............................................................................ 528
How to apply the second normal form ........................................................................ 530
How to apply the third normal form .............................................. 532
When and how to denormalize a data structure ......................................................... 534
A database design tool ..................................................................536
An introduction to MySQL Workbench ..................................................................... 536
How to use MySQL Workbench to create database diagrams ................................... 538

Chapter 17 How to use SQL to create a database


How to work with databases ..........................................................544
How to create a database ............................................................................................. 544
How to select a database ............................................................................................. 544
How to drop a database ................................................................................................... 544
How to work with tables .................................................................546
An introduction to MySQL data types ....................................................................... 546
How to create a table ....................................................................................................... 548
How to code a primary key .......................................................................................... 550
How to code a foreign key constraint ......................................................................... 552
How to alter a table .......................................................................................................... 554
How to drop a table ...................................................................................................... 556
How to work with indexes ..............................................................558
How to create an index ............................................................................................... 558
How to drop an index ................................................................................................... 558
How to work with users and privileges ........................................ 560
A summary of privileges ............................................................................................ 560
How to create, rename, and drop users ....................................................................... 562
How to grant privileges .................................................................................................... 564
How to revoke privileges ............................................................................................ 566
How to view privileges ................................................................................................. 568
••
XII Expanded contents

Other skills for creating a database.............................................. 570


How to load data from text files .................................................................................. 570
How to dump a database to a SQL script ................................................................... 572
The script for the Guitar Shop database ...................................... 574
Chapter 18 How to use SQL to work with a database
How to select data from a single table .........................................582
How to select columns from a table ............................................................................ 582
How to use an alias for a column ................................................................................. 584
How to select rows with a LIMIT clause .................................................................... 586
How to select rows with a WHERE clause ................................................................. 588
How to use the logical operators.................................................................................... 590
How to use the IS NULL operator.............................................................................. 592
How to use the LIKE operator ...................................................................................... 594
How to sort rows with an ORDER BY clause ............................................................ 596
How to select data from multiple tables ....................................... 598
How to code an inner join ............................................................................................. 598
When and how to use table aliases ............................................................................. 600
How to code summary queries......................................................602
How to code aggregate functions ................................................................................ 602
How to group queries by column ................................................................................ 604
How to code subqueries ................................................................606
Where to use subqueries ................................................................................................ 606
How to code correlated subqueries ............................................................................. 608
How to insert, update, and delete rows ........................................ 610
How to insert rows ...................................................................................................... 610
How to update rows ....................................................................................................... 612
How to delete rows ...................................................................................................... 614

Chapter 19 Professional PHP for working with MySQL


Three ways to use PHP to work with MySQL ............................... 620
PDO (PHP Data Objects) ............................................................................................ 620
PHP's mysqli extension.................................................................................................. 620
PHP's MySQL extension ............................................................................................. 620
How to work with PDO ....................................................................622
How to connect to a database ...................................................................................... 622
How to select data ....................................................................................................... 622
How to insert, update, and delete data ........................................................................ 624
How to work with prepared statements ...................................................................... 626
How to set the error mode for PDO ............................................................................ 630
A model in PDO ........................................................................................................... 632
How to work with mysqli ................................................................638
How to connect to a database ..................................................................................... 638
How to select data ....................................................................................................... 640
How to insert, update, and delete data ........................................................................ 642
How to work with prepared statements ...................................................................... 644
The object-oriented style compared to the procedural style ...................................... 648
A model in mysqli ....................................................................................................... 650

Chapter 20 A database-driven website


How to work with large text columns............................................658
A simple content management system ........................................................................ 658
How to add HTML tags to text ................................................................................... 660
•••
Expanded contents XIII

The include files for the Guitar Shop website ............................. 662
The Home page .............................................................................................................. 662
The directory structure ............................................................................................... 662
The utility files ............................................................................................................... 664
The view files .............................................................................................................. 664
The Product Catalog application ................................................... 670
The user interface .......................................................................................................... 670
The controller ............................................................................................................................................ 670
The view ............................................................................................................................... 670
The Product Manager application ................................................. 674
The user interface ............................................................................................................. 674
The controller .................................................................................................................................. 676
The view .......................................................................................................................... 678

Section 4 Master the advanced skills


for building websites
Chapter 21 How to create secure websites
How to use a secure connection ...................................................688
An introduction to secure connections ....................................................................... 688
How SSL authentication works ...................................................................................... 690
How to get a digital secure certificate ........................................................................ 692
How to request a secure connection ........................................................................... 694
How to redirect to a secure connection ...................................................................... 696
How to use authentication .............................................................698
Three types of authentication ..................................................................................... 698
How to store and validate a password......................................................................... 700
How to use form-based authentication ....................................................................... 704
How to use basic authentication................................................................................... 710
How to work with cryptography .................................................... 714
An introduction to four cryptography libraries .......................................................... 714
How to install the Defuse cryptography library ......................................................... 716
How to encrypt and decrypt data ................................................................................ 716
A class for encrypting and decrypting data ................................................................ 718

Chapter 22 How to send email


How to send email ..........................................................................724
How email works .................................................................................................................................... 724
How to set up a test email account ............................................................................. 726
How to use PHPMailer to send an email .................................................................... 728
A helper function for sending an email ...................................................................... 730
How to use the helper function to send an email ........................................................ 732
The Registration application .........................................................734
The user interface .................................................................................................................................... 734
The controller ...................................................................................................................................... 736
The views .............................................................................................................................. 738

Chapter 23 How to work with files, uploads, and images


How to work with files .................................................................... 744
How to get a directory listing ....................................................................................................... 744
How to read and write an entire file ........................................................................... 746
How to read and write part of a file ............................................................................ 748
How to read and write CSV data ..................................................................................... 750
How to copy, rename, and delete a file ....................................................................... 752

XIV Expanded contents

How to upload a file ........................................................................754


HTML for uploading a file ............................................................................................ 754
PHP for working with an uploaded file ...................................................................... 754
How to work with images ...............................................................756
How to get information about an image ..................................................................... 756
How to read and write images .................................................................................... 758
How to resize an image .................................................................................................. 760
How to work with transparency .................................................................................. 762
The Image Upload application .......................................................764
The user interface ....................................................................................................... 764
The utility files ............................................................................................................ 766
The controller .............................................................................................................. 772
The view ........................................................................................................................ 774

Chapter 24 An eCommerce website


An introduction to the website ......................................................780
Prototyping and stepwise refinement.......................................................................... 780
The directory structure of the website ........................................................................ 782
The user interface for end users ...................................................784
The Catalog application .............................................................................................. 784
The Cart application ...................................................................................................... 786
The C:::heckout and Account applications .................................................................... 786
The My Account page ..................................................................................................... 790
The user interface for administrators ...........................................792
The Admin Login and Admin Menu pages ................................................................ 792
The Product Manager application............................................................................... 794
The C:::ategory Manager application ............................................................................ 794
The Order Manager application .................................................................................. 794
The Account Manager application .............................................................................. 794

Appendix A How to set up Windows for this book


How to install Chrome and Notepad++.........................................802
How to install the C:::hrome browser ............................................................................ 802
How to install Notepad++ .......................................................................................... 802
How to install and configure XAMPP ............................................804
How to install XAMPP ................................................................................................... 804
How to set the default time zone for PHP................................................................... 804
How to start and stop the Apache and MySQL servers .............................................. 806
How to configure phpMyAdmin ................................................................................. 808
How to install the book applications and databases .................. 810
How to install the source code for this book .............................................................. 810
How to create and restore the databases ..................................................................... 812
How to install NetBeans and Xdebug ........................................... 814
How to install NetBeans ............................................................................................. 814
How to install Xdebug ................................................................................................. 814

Appendix B How to set up Mac OS X for this book


How to install Chrome and BBEdit................................................ 818
How to install the C:::hrome browser ............................................................................ 818
How to install BBEdit .................................................................................................. 818
Expanded contents XV

How to install and configure XAMPP ............................................ 820


How to install XA.MPP .................................................................................................. 820
How to set the default time zone for PHP ................................................................... 820
How to start and stop the Apache and MySQL servers .............................................. 822
How to configure phpMyAdmin ................................................................................. 824
How to install the book applications and databases .................. 826
How to install the source code for this book .............................................................. 826
How to create and restore the databases ..................................................................... 828
How to install NetBeans and Xdebug ........................................... 830
How to install N etBeans ............................................................................................. 830
How to install Xdebug ................................................................................................... 830

Appendix C How to set up Linux for this book


The Chrome I Chromium browser .................................................834
How to install the Chromium browser on Ubuntu ..................................................... 834
How to install the Chrome browser on Fedora ........................................................... 836
How to install and configure XAMPP ............................................ 838
How to install XAMPP .................................................................................................. 838
How to set the default time zone for PHP ................................................................... 838
How to start and stop the Apache and MySQL servers .............................................. 840
How to change ownership of the htdocs directory ..................................................... 840
How to configure phpMyAdmin ................................................................................. 842
How to install NetBeans .................................................................844
How to install N etBeans ......................................................................................................... 844
How to build and configure Xdebug ........................................................................... 846
How to install the book applications and databases .................. 848
How to install the source code for this book .............................................................. 848
How to create and restore the databases ..................................................................... 850
Introduction
Ever since it was created in 1995, PHP has been a favorite of developers for
server-side web programming. In some surveys, it stands as today's most popular
web programming language. By most counts, over a million websites have been
written in PHP, including portions of today's largest, most recognizable sites, and
often in tandem with MySQL as the database. As a result, there's a continuing
demand for web developers who know PHP and MySQL at the professional level.
With this book, you can become one of them.
In terms of content, this 3rd Edition of the book has been updated to present
the most important features of PHP 7. In addition, it reflects the current best
practices for PHP and MySQL programming, which are constantly evolving. As
a result, we believe that this is the best edition of this book to date and the right
choice for anyone who wants to use PHP today.

Who this book is for


This book is for anyone who wants to learn how to build and maintain
websites that use PHP with MySQL or MariaDB, which are essentially
interchangeable. The only prerequisite for this book is that you have basic HTML
and CSS skills. If you don't have these skills, you can get them by reading the
first 11 chapters of Murach's HTML5 and CSS3 (3rd Edition).

What this book does


This book gets you started with PHP and MySQL as quickly as possible
and then builds out your skills in a professional way. To present the whole array
of PHP and MySQL skills in a manageable progression, it's divided into four
sections.
• Section 1 gets you off to a fast start whether or not you have any
programming experience. To do that, chapter 2 presents a complete subset
of PHP. Chapter 3 shows you how to use a MySQL database. Chapter 4
shows you how to develop database applications with PHP. Chapter 5 shows
how to structure the code in your applications by using the MVC pattern.
And chapter 6 shows you how to test and debug your web applications.
When you finish this section, you'll understand how all the pieces of a web
application fit together, and you'll be ready for rapid progress in the sections
that follow. Most important, you'll be able to build database-driven web
applications of your own!
•••
XVIII Introduction

• In section 2, you'll expand your basic PHP skills to include the professional
skills you'll need on the job every day. That means you'll soon be coding
applications that use arrays, functions, regular expressions, exception
handling, libraries, your own objects ... and more! The last application in this
section illustrates an object-oriented approach to data validation that you
can use as a model for data validation in your own applications.
• In section 3, you'll expand your basic MySQL and PHP skills to include the
skills you need for building full-fledged database-driven web applications.
In chapter 16, you'll learn how to design a database. In chapter 17, you'll
learn how to use SQL DDL statements to create a database and control user
access to it. In chapter 18, you'll learn how to use SQL DML statements
to extract and update the data in a MySQL database. And in chapters 19
and 20, you'll learn the advanced PHP skills that you need for developing
database applications.
• The last section in this book rounds out your web development skills by
showing you how to secure a website, how to send email, and how to work
with files, uploads, and images. You need these skills to make sure your web
applications come across as trustworthy, reliable, and fully professional to
your visitors. Then, the last chapter in this section shows how to put all your
skills together in an eCommerce website.

Why you'll learn faster and better with this book


Like all our books, this one has features that you won't find in competing
books. That's why we believe you'll learn faster and better with our book than
with any other. Here are just a few of those features.
• Because section 1 presents a complete subset of PHP and MySQL in just 6
chapters and 206 pages, you're ready for productive work much faster than
you are when you use competing books. This section also uses a
self-paced approach that lets experienced programmers move more quickly
and beginners work at a pace that's comfortable for absorbing all of the new
information.
• Because the next three sections present all of the other skills that you need
for developing web applications at a professional level, you can go from
beginner to professional in a single book.
• The exercises at the end of each chapter let you practice what you've just
learned. However, to make sure you get the most practice in the least time,
these exercises start from applications that you download from our website.
This download also includes the solutions to the exercises so you can get
help whenever you need it.
• If you page through this book, you'll see that all of the information is
presented in ''paired pages," with the essential syntax, guidelines, and
examples on the right page and the perspective and extra explanation on the
left page. This helps you learn faster by reading less ... and this is the ideal
reference format when you need to refresh your memory about how to do
something.

Introduction XIX

• To show you how all of the pieces of a PHP and MySQL application work
together, this book presents the HTML, PHP, and MySQL code for 16
applications, ranging from the simple to the complex. As we see it, the only
way to master PHP programming is to study the code in applications like
these.
• This book also presents dozens of short examples. As a result, you can
easily find an example that shows how to do whatever you need to do as you
develop web applications. Our ''paired pages'' presentation helps with this
because you don't have to dig out examples that are embedded in the text.

What software you need


To run web applications that use PHP and MySQL, you need the Apache
web server, the MySQL (or MariaDB) database server, and the PHP interpreter.
All three of these can be downloaded and installed for free in a single download
called XAMPP.
To edit your PHP code, we recommend using an Integrated Development
Environment that's designed for working with PHP. In particular, we recommend
the NetBeans IDE for PHP. This IDE includes a text editor that makes it easy to
enter and edit HTML, CSS, and PHP code. It provides an easy way for you to
run your applications. And it can be configured to include a debugger that can
help you debug your applications.
To edit other text files, such as the configuration files for PHP, you can use
any text editor that you like. If you don't already have a favorite, we recommend
Notepad++ for Windows and BBEdit for Mac OS X. Both are available for free.
And both are excellent text editors that can also be used to work with HTML,
CSS, and PHP code whenever an IDE seems like too much.
To test any web application, including PHP and MySQL applications, you
just need a web browser. For that, we recommend Google Chrome. It too is
available for free.

What operating systems this book supports


All of the software that you need for developing web applications with
PHP and MySQL is available for Windows, Mac OS X, and Linux. To help you
install this software, the appendixes provide the procedures that you'll need for
installing this software on Windows, Mac OS X, and Linux systems.

How our downloadable files can help you learn


If you go to our website at www.murach.com, you can download all the files
that you need for getting the most from this book. These files include:
• the source code for the applications presented in this book
• the starting points for the exercises that are at the end of each chapter
• the solutions to the exercises
XX Introduction

The source code for the book applications is valuable because it lets you run
the applications on your own PC, experiment with the source code, and copy and
paste any of the source code into your own applications. The exercise starts and
solutions are valuable because they let you practice what you've learned on your
own to gain valuable hands-on experience. Here again, the appendixes show you
how to download and install these files.

Support materials for trainers and instructors


If you're a corporate trainer or a college instructor who would like to use
this book for a course, we offer an Instructor's CD that includes: (1) instructional
objectives, (2) PowerPoint slides, (3) test banks, (4) exercise enhancements, and
(5) student projects.
To learn more about this Instructor's CD and to find out how to get it, please
go to our website at www.murach.com. Or, if you prefer, you can call Kelly at
1-800-221-5528 or send an email to kelly@murach.com.

2 companion books
Although this book presents the basic skills for designing, creating, and
working with MySQL databases, there's a lot more to learn about MySQL. To
learn more, we recommend Murach's MySQL (2nd Edition). This book shows
how to code queries for complex retrievals that you can use with your PHP code.
It shows how to use advanced features like stored procedures, functions, triggers,
and events. And it shows how to administer a database.
As you'll see in this book, you can embed PHP code within HTML that
defines the content and structure of a page. Then, you can use CSS to format that
content. Even if you have basic HTML and CSS skills, the best web developers
master HTML and CSS. To that end, we recommend Murach 's HTML5 and
CSS3 (3rd Edition).

Please let us know how this book works for you


When we started this book, Ray and I had two goals. First, we wanted to
make it easier than ever for you to get started with PHP and MySQL. Second,
we wanted you to be able to quickly raise your skills to the expert level. Now, we
hope that we have succeeded.
If you have any comments about this book, please email us at
murachbooks@murach.com. We thank you for buying this book. And we wish
you all the best with your PHP and MySQL programming.

Joel Murach
Author
Get started fast
with PHP and MySQL
The six chapters in this section are designed to get you off to a fast
start with PHP and MySQL. First, in chapter 1, you'll learn how web
programming with PHP works and what tools you can use to develop PHP
applications. Then, in chapter 2, you'll learn how to use PHP to develop
applications that don't require a database.
The next two chapters get you going with MySQL databases. In
chapter 3, you'll learn how a relational database works and how to use
phpMyAdmin to work with a MySQL database. In chapter 4, you'll learn
how to develop PHP applications that get data from and store data in a
MySQL database.
The last two chapters in this section round out your skillset. First,
chapter 5 shows you how to structure and organize your code by using the
MVC pattern. Then, chapter 6 presents the techniques that you will need
for testing and debugging applications.
When you complete this section, you'll have all the skills that you need
for coding, testing, and debugging significant database applications. Then,
you can enhance those skills by reading the chapters in any of the other
sections.
Introduction to web
development with PHP
This chapter introduces you to the concepts and terms that you need for
developing web applications with PHP. This chapter also shows you how to
deploy, edit, and test a PHP application. When you finish this chapter, you'll
have all the background you need for learning how to write the code for PHP
applications.

The architecture of a web application ..................................4


How a client-server architecture works ...........................................................4
How static web pages are processed................................................................6
How dynamic web pages are processed .......................................................... 8
A survey of web application software ........................................................... 10
Highlights in the history of PHP ................................................................... 12
Highlights in the history of MySQL.............................................................. 12
The Product Discount application ...................................... 14
The user interface ............................................................................................. 14
The HTML file .............................................................................................. 16
The CSS file ........................................................................................................... 18
The PHP file.........................................................................................................20
How to edit and test a PHP application .............................. 22
How to edit a PHP page with a text editor..................................................... 22
How to start and stop Apache and MySQL on your own computer............. 24
How to deploy a PHP application ..................................................................26
How to run a PHP application .......................................................................28
How to test and debug a PHP page ................................................................ 30
How to view the source code for a web page ................................................ 32
How to use NetBeans to develop a PHP application ........ 34
How to work with PHP projects and files ...................................................... 34
How to edit and test a PHP application ......................................................... 36
How to import and configure a PHP project ................................................. 38
f>E!r!;J>E!<:ti"~ •.............••.....•......•.......•......••.....•...•..•......•.......•.. tl.C>
Discovering Diverse Content Through
Random Scribd Documents
Aut atros ubinam manibus orta tua!
O tu casurus, rem non mersurus acuto
Telo, sis-ne, tenet? non tenet ensis, olet." Harry Leroy Temple.

Bells at Funerals (Vol. ii., p. 478.).—The following extract will


doubtless be interesting to Mr. Gatty, if it has hitherto escaped his
notice:

"June 27 (1648).—The visitors ordered that the bellman of the


university should not go about in such manner as was
heretofore used at the funeral of any member of the university.
This was purposely to prevent the solemnity that was to be
performed at the funeral of Dr. Radcliffe, Principal of B. N. C.,
lately dead. For it must be known that it hath been the custom,
time out of mind, that when head of house, doctor, or master of
considerable degree was to be buried, the university bellman
was to put on the gown and the formalities of the person
defunct, and with his bell go into every college and hall, and
there make open proclamation, after two rings with his bell, that
forasmuch as God had been pleased to take out of the world
such a person, he was to give notice to all persons of the
university, that on such a day, and at such an hour, he was
solemnly to be buried, &c. But the visitors did not only forbid
this, but the bellman's going before the corpse, from the house
or college, to the church or chapel."—A. Wood, quoted in
Oxoniana, vol. iv. p. 206.
E. H. A.

Collar of SS. (Vol. vi., pp. 182. 352.).—There is, in the church of
Fanfield, Yorkshire, among other tombs and effigies of the
Marmions, the original lords of the place, a magnificent tomb of
alabaster, on which are the recumbent figures of a knight and his
lady, in excellent preservation. These are probably effigies of Robert
Marmion and his wife Lota, second daughter of Herbert de St.
Quintin, who died in the latter part of the fourteenth, or early in the
fifteenth century. The armour of the knight is of this period, and he
is furnished with the SS. collar of Lancaster, which is developed in a
remarkably fine manner. His juppon is furnished with the vaire, the
bearing of the Marmion, whilst the chevronels of St. Quintin are
evident on the mantle of the lady. Over the tomb is placed a herse of
iron, furnished with stands for holding lighted candles or torches.
Wm. Procter.
York.

Dr. Marshall (Vol. vii., p. 83.).—I beg to inform U. I. S. that the King's
chaplain and Dean of Gloucester in 1682 was not Anthony, but
Thomas Marshall, D.D., Rector of Lincoln College, Oxford, a great
benefactor to his college and the university, and highly distinguished
for his knowledge of the Oriental and Teutonic languages.
E. H. A.

Shelton Oak (Vol. vii., p. 193.).—Shelton Oak is a remarkable fine


tree, and is still standing. It is apparently in a healthy state. The
grounds and mansion (I believe) are in the possession of two
maiden ladies, who allow visitors free access to this interesting
object. In summer time its owners and their friends frequently tea
within its venerable trunk.

The acorns are dealt out to those who may wish them at a trifling
sum, and the money devoted towards the building of a church in the
neighbouring locality. It is to be hoped that no innovation or local
improvement will ever necessitate its removal.
H. M. Bealby.
North Brixton.

"God and the world" (Vol. vii., p. 134.).—Fulke Greville, Lord Brooke,
was the author of the lines quoted by W. H., but he has not given
them correctly. They may be found in the LXVI. and LXVII. stanzas of
his Treatie of Warres, and are as follows:

LXVI.
"God and the world they worship still together,
Draw not their lawes to him, but his to theirs,
Untrue to both, so prosperous in neither,
Amid their own desires still raising fears:
Unwise, as all distracted powers be,
Strangers to God, fooles in humanitie.

LXVII.

"Too good for great things, and too great for good,
Their princes serve their priest, yet that priest is
Growne king, even by the arts of flesh and blood," &c.
Workes, p. 82.: London, 1633, 8vo.

As for the last line of the quotation:

"While still 'I dare not' waits upon 'I would,'"

it smacks very strongly of Macbeth (Act I. Sc. 7.), and "the poor cat
i'th adage:"

"Catus amat pisces, sed non vult tingere plantas."


Rt.
Warmington.

Dreng (Vol. vii., p. 39.).—Dreng is still the Danish term for a servant
or a boy: their present station in society could perhaps be only found
by a correspondence with Copenhagen; and would then possibly
give as little elucidation of their former social position as an
explanation of our modern villain would throw any light upon the
villani of Domesday Book.
William Bell.
17. Gower Place.

Meals (Vol. vii., p. 208.).—In Celtic, the word Meall means any rising
ground of a round form, such as a low hillock; and the name of
Mealls may have been given to sand-banks from having a
resemblance to small hills at low water.
Fras. Crossley.

Along the sea-margin of the tongue of land between the rivers


Mersey and Dee, the sand has been thrown up in domes. Two little
hamlets built among those sand-hills are called North and South
Meols.
J. M. N.
Liverpool.

Richardson or Murphy (Vol. vii., p. 107.).—I possess a copy of


Literary Relics of the late Joseph Richardson, Esq., formerly of St.
John's College, Cambridge, &c., 4to.: London, 1807. Prefixed, is a
line engraving by W. J. Newton, from a painting by M. A. Shee, Esq.,
R.A. This is a subscriber's copy, and belonged as such to one of my
nearest relatives. The inscription at the bottom of the plate is the
same as that mentioned by your correspondent; and I cannot but
think the portrait is really that of J. Richardson. The book was
published by Ridgway, No. 170. Piccadilly.
C. I. R.
Miscellaneous.
BOOKS AND ODD VOLUMES
WANTED TO PURCHASE.

Memoirs of the Rose, by Mr. John Holland. 1 Vol. 12mo. London, 1824.

Psyche and Other Poems, by Mrs. Mary Tighe. Portrait. 8vo. 1811.

Gmelin's Handbook of Chemistry. Inorganic Part.

Archæologia. Vols. III., IV., V., VI., VII., VIII., X., XXVII., XXVIII.,
unbound.

The History of Shenstone, by the Rev. H. Saunders. 4to. London. 1794.

Lubbock's Elementary Treatise on the Tides.

Transactions of the Microscopical Society of London. Vol. I., and Parts I.


and II. of Vol. II.

Curtis's Botanical Magazine. 1st and 2nd Series collected.

Todd's Cyclopædia of Anatomy and Physiology. Complete, or any Portion.

Gladstone's (W. E.) Two Letters to the Earl of Aberdeen on the State
Prosecutions of the Neapolitan Government. 1st Edition. 8vo.

Swift's Works. Dublin: G. Faulkner. 19 Vols. 8vo. 1768. Vol. I.

Pursuit of Knowledge under Difficulties. Original Edition. Vol. I.

The Book of Adam.


The Christian Magazine. Vol. for 1763.

Pro Matrimonio Principis cum defunctæ Uxoris Sorore contracto Responsum


Juris Collegii Jurisconsultorum in Academia Rintelensi (circa 1655).

Monner Jurisconsult., de Matrimonio.

Brückner, de Matrimonio.
* *
* Correspondents sending Lists of Books Wanted are requested to
send their names.
* *
* Letters, stating particulars and lowest price, carriage free, to be
sent to Mr. Bell, Publisher of "NOTES AND QUERIES," 186. Fleet
Street.

Notices to Correspondents.
The length of several of the communications in our present Number
compels us to postpone this week our Notes on Books, &c.

S. (Sunderland). We must refer our Correspondent who inquires


respecting eating Carlings (or Grey Peas) upon Care or Carle Sunday,
and the connexion between that name and Char Freytag, the
German name for Good Friday, to Brand's Popular Antiquities, vol. i.
pp. 113-116. (ed. Bohn.)

R. Elliott, Esq. We have a letter for this Photographic Correspondent.


Where shall we direct it?

R. J. S., who inquires as to Richard Brandon having been the


executioner of Charles I., is referred to Sir H. Ellis's Letters
Illustrative of English History (2nd Series, vol. iii. pp. 340, 341.); and
to "N. & Q.," Vol. ii., pp. 110. 158. 268.; Vol. v., p. 28.; Vol. vi., p.
198.
W. M. R. E. How can we address a letter to this Correspondent?

David Brown. The lines


"For he who fights and runs away
May live to fight another day,"

so generally supposed to be Butler's, are really from Mennis' and


Smith's Musarum Deliciæ. For much curious illustration of them, see
our 1st Vol., pp. 177. 210., &c.

A. H. The words which Cæsar addressed to Brutus were, "Tu


quoque, Brute."

Inquisitor. Stow tell us that Bevis Marks is a corruption of Burie's


Marks,—a great house belonging to the Abbots of Bury having
formerly stood there.

J. L. S. will find an article on the speech of the Clown, in Twelfth


Night, to Toby Belch and Sir Andrew Ague-cheek: "Did you never see
the picture of We Three?" in our 5th Vol., p. 338., &c.

C. V. The Journal in question is sold to those who are not members


of the Society.

W. D. B. We do not think that the majority of our readers would be


pleased to see our columns occupied with the proposed discussion
respecting The American Sea Serpent.

Rev. J. L. Sisson's Photographic Notes in our next. We accept with


thanks the polite offer made by our Correspondent in his postscript.

Cokely. The fine reticulated lines in question are caused by the hypo-
soda not being thoroughly washed off.

PHOTOGRAPHIC PICTURES.—A Selection of the above beautiful


Productions may be seen at BLAND & LONG'S, 153. Fleet Street,
where may also be procured Apparatus of every Description, and
pure Chemicals for the practice of Photography in all its Branches.
Calotype, Daguerreotype, and Glass Pictures for the Stereoscope.

BLAND & LONG, Opticians, Philosophical and Photographical


Instrument Makers, and Operative Chemists, 153. Fleet Street.

TO PHOTOGRAPHERS.—MR. PHILIP DELAMOTTE begs to announce


that he has now made arrangements for printing Calotypes in large
or small quantities, either from Paper or Glass Negatives. Gentlemen
who are desirous of having good impressions of their works, may
see specimens of Mr. Delamotte's Printing at his own residence, 38.
Chepstow Place, Bayswater, or at

MR. GEORGE BELL'S, 186. Fleet Street.

PHOTOGRAPHY.—Collodion (Iodized with the Ammonio-Iodide of


Silver)—J.B. HOCKIN & CO., Chemists, 289. Strand, were the first in
England who published the application of this agent (see Athenæum,
Aug. 14th). Their Collodion (price 9d. per oz.) retains its
extraordinary sensitiveness, tenacity, and colour unimpaired for
months: it may be exported to any climate, and the Iodizing
Compound mixed as required. J.B. HOCKIN & CO. manufacture PURE
CHEMICALS and all APPARATUS with the latest Improvements
adapted for all the Photographic and Daguerreotype processes.
Cameras for Developing in the open Country. GLASS BATHS adapted
to any Camera. Lenses from the best Makers. Waxed and Iodized
Papers, &c.

Just published, price 1s., free by Post 1s. 4d.,

The WAXED-PAPER PHOTOGRAPHIC PROCESS of GUSTAVE LE


GRAY'S NEW EDITION. Translated from the French.

Sole Agents in the United Kingdom for VOIGHTLANDER & SON'S


celebrated Lenses for Portraits and Views.
General Depôt for Turner's, Whatman's, Canson Frères', La Croix,
and other Talbotype Papers.

Pure Photographic Chemicals.

Instructions and Specimens in every Branch of the Art.

GEORGE KNIGHT & SONS, Foster Lane, London.

PHOTOGRAPHIC PAPER.—Negative and Positive Papers of


Whatman's, Turner's, Sanford's, and Canson Frères' make. Waxed-
Paper for Le Gray's Process. Iodized and Sensitive Paper for every
kind of Photography.

Sold by JOHN SANFORD, Photographic Stationer, Aldine Chambers,


13. Paternoster Row, London.

BENNETT'S MODEL WATCH, as shown at the GREAT EXHIBITION.


No. 1. Class X., in Gold and Silver Cases, in five qualities, and
adapted to all Climates, may now be had at the MANUFACTORY, 65.
CHEAPSIDE. Superior Gold London-made Patent Levers. 17, 15, and
12 guineas. Ditto, in Silver Cases, 8, 6, and 4 guineas. First-rate
Geneva Levers, in Gold Cases, 12, 10, and 8 guineas. Ditto, in Silver
Cases, 8, 6, and 5 guineas. Superior Lever, with Chronometer
Balance, Gold, 27, 23, and 19 guineas. Bennett's Pocket
Chronometer, Gold, 50 guineas; Silver, 40 guineas. Every Watch
skilfully examined, timed, and its performance guaranteed.
Barometers, 2l., 3l., and 4l. Thermometers from 1s. each.

BENNETT, Watch, Clock and Instrument Maker to the Royal


Observatory, the Board of Ordnance, the Admiralty, and the Queen,

65. CHEAPSIDE.
TO PHOTOGRAPHERS.—Pure Chemicals, with every requisite for the
practice of Photography, according to the instructions of Le Gray,
Hunt, Brébisson, and other writers, may be obtained, wholesale and
retail, of WILLIAM BOLTON, (formerly Dymond & Co.), Manufacturer
of pure chemicals for Photographic and other purposes. Lists may be
had on application.

Improved Apparatus for iodizing paper in vacuo, according to Mr.


Stewart's instructions.

146. HOLBORN BARS.

PHOTOGRAPHY—The AMMONIO-IODIDE OF SILVER in Collodion,


prepared by MESSRS. DELATOUCHE & CO., Operative Chemists, 147.
Oxford Street, is now generally used by Photographers, and cannot
be surpassed in the beautiful results it produces. Specimens may be
seen on application. MESSRS. DELATOUCHE & CO. supply Apparatus
with the most recent Improvements, Pure Chemicals, English and
Foreign Papers, and every Article connected with Photography on
Paper or Glass. Instruction given in the Art.

See HENNAH'S new work on the Collodion Process, giving the most
practical directions yet published, price 1s., or free by post 1s. 6d.

PHOTOGRAPHY.—HORNE & CO.'S Iodized Collodion, for obtaining


Instantaneous Views, and Portraits in from three to thirty seconds,
according to light.

Portraits obtained by the above, for delicacy of detail rival the


choicest Daguerreotypes, specimens of which may be seen at their
Establishment.

Also every description of Apparatus, Chemicals, &c. &c. used in this


beautiful Art.—123. and 121. Newgate Street.
WESTERN LIFE ASSURANCE AND ANNUITY
SOCIETY.
3. PARLIAMENT STREET, LONDON.

Founded A.D. 1842.

Directors.

H. E. Bicknell, Esq. J. H. Goodhart, Esq.


W. Cabell, Esq. T. Grissell, Esq.
T. S. Cocks, Jun. Esq., M.P. J. Hunt, Esq.
G. H. Drew, Esq. J. A. Lethbridge, Esq.
W. Evans, Esq. E. Lucas, Esq.
W. Freeman, Esq. J. Lys Seager, Esq.
F. Fuller, Esq. J. B. White, Esq.
J. Carter Wood, Esq.

Trustees.—W. Whateley, Esq., Q.C.; L. C. Humfrey, Esq., Q.C.;


George Drew, Esq.,
Physician.—William Rich. Basham, M.D.
Bankers.—Messrs. Cocks, Biddulph, and Co., Charing Cross.

VALUABLE PRIVILEGE.

POLICIES effected in this Office do not become void through


temporary difficulty in paying a Premium, as permission is given
upon application to suspend the payment at interest, according to
the conditions detailed in the Prospectus.

Specimens of Rates of Premium for Assuring 100l., with a Share in


three-fourths of the Profits:—

Age £ s. d. Age £ s. d.
1 14 4 2 10 8
17 32
1 18 8 2 18 6
22 37
2 4 5 3 8 2
27 42

ARTHUR SCRATCHLEY, M.A., F.R.A.S., Actuary.

Now ready, price 10s. 6d., Second Edition, with material additions,
INDUSTRIAL INVESTMENT and EMIGRATION: being a TREATISE ON
BENEFIT BUILDING SOCIETIES, and on the General Principles of
Land Investment, exemplified in the Cases of Freehold Land
Societies, Building Companies, &c. With a Mathematical Appendix on
Compound Interest and Life Assurance. By ARTHUR SCRATCHLEY,
M.A., Actuary to the Western Life Assurance Society, 3. Parliament
Street, London.

THE QUARTERLY REVIEW, No. CLXXXIV.—Advertisements for the


forthcoming Number must be forwarded to the Publisher by the
26th, and Bills for insertion by the 28th instant.

JOHN MURRAY, Albemarle Street.

8vo., price 21s.

SOME ACCOUNT of DOMESTIC ARCHITECTURE in ENGLAND, from


the Conquest to the end of the Thirteenth Century, with numerous
Illustrations of Existing Remains from Original Drawings. By T.
HUDSON TURNER.

"What Horace Walpole attempted, and what Sir Charles Lock


Eastlake has done for oil-painting—elucidated its history and
traced its progress in England by means of the records of
expenses and mandates of the successive Sovereigns of the
realm—Mr. Hudson Turner has now achieved for Domestic
Architecture in this country during the twelfth and thirteenth
centuries."—Architect.

"The book of which the title is given above is one of the very
few attempts that have been made in this country to treat this
interesting subject in anything more than a superficial manner.

"Mr. Turner exhibits much learning and research, and he has


consequently laid before the reader much interesting
information. It is a book that was wanted, and that affords us
some relief from the mass of works on Ecclesiastical
Architecture with which of late years we have been deluged.

"The work is well illustrated throughout with wood-engravings


of the more interesting remains, and will prove a valuable
addition to the antiquary's library."—Literary Gazette.

"It is as a text-book on the social comforts and condition of the


Squires and Gentry of England during the twelfth and thirteenth
centuries, that the leading value of Mr. Turner's present
publication will be found to consist.

"Turner's handsomely-printed volume is profusely illustrated


with careful woodcuts of all important existing remains, made
from drawings by Mr. Blore and Mr. Twopeny."—Athenæum.

JOHN HENRY PARKER, Oxford; and 377. Strand, London.

FOR SALE.

THE ILLUSTRATED CLARENDON, formerly in the Duke of


Buckingham's Library at Stowe. This splendid Copy of CLARENDON'S
HISTORY OF THE REBELLION is in Three Volumes folio, Largest
Paper, old red morocco with gilt edges, and contains upwards of 200
engraved Portraits of Historical Persons, many of great rarity, and by
Eminent Masters. The added Portraits all neatly inlaid, and the whole
forming a rare and highly interesting Collection. Price 21l. Apply by
letter addressed to G., care of MR. BELL, Publisher, Fleet Street.

KERR & STRANG, Perfumers and Wig-Makers, 124. Leadenhall


Street, London, respectfully inform the Nobility and Public that they
have invented and brought to the greatest perfection the following
leading articles, besides numerous others:—Their Ventilating Natural
Curl; Ladies and Gentlemen's PERUKES, either Crops or Full Dress,
with Partings and Crown so natural as to defy detection, and with or
without their improved Metallic Springs; Ventilating Fronts,
Bandeaux, Border, Nattes, Bands à la Reine, &c.; also their
instantaneous Liquid Hair Dye, the only dye that really answers for
all colours, and never fades nor acquires that unnatural red or purple
tint common to all other dyes; it is permanent, free of any smell,
and perfectly harmless. Any lady or gentleman, sceptical of its
effects in dyeing any shade of colour, can have it applied, free of any
charge, at KERR & STRANG'S, 124. Leadenhall Street.

Sold in Cases at 7s. 6d., 15s., and 20s. Samples, 3s. 6d., sent to
all parts on receipt of Post-office Order or Stamps.

The Camden Society,


FOR THE PUBLICATION OF

EARLY HISTORICAL AND LITERARY REMAINS.

THE CAMDEN SOCIETY is instituted to perpetuate, and render


accessible, whatever is valuable, but at present little known,
amongst the materials for the Civil, Ecclesiastical, or Literary History
of the United Kingdom; and it accomplishes that object by the
publication of Historical Documents, Letters, Ancient Poems, and
whatever else lies within the compass of its designs, in the most
convenient forms, and at the least possible expense consistent with
the production of useful volumes.

The Subscription to the Society is 1l. per annum, which becomes due
in advance on the first day of May in every year, and is received by
MESSRS. NICHOLS, 25. PARLIAMENT STREET, or by the several
LOCAL SECRETARIES. Members may compound for their future
Annual Subscriptions, by the payment of 10l. over and above the
Subscription for the current year. The compositions received have
been funded in the Three per Cent, Consols to an amount exceeding
900l. No Books are delivered to a Member until his Subscription for
the current year has been paid. New Members are admitted at the
Meetings of the Council held on the First Wednesday in every month.

The Publications for the past year (1851-2) were:

52. PRIVY PURSE EXPENSES of CHARLES II. and JAMES II. Edited by
J. Y. AKERMAN, Esq., Sec. S.A.

53. THE CHRONICLE OF THE GREY FRIARS OF LONDON. Edited


from a MS. in the Cottonian Library by J. GOUGH NICHOLS, Esq.,
F.S.A.

54. PROMPTORIUM: An English and Latin Dictionary of Words in Use


during the Fifteenth Century, compiled chiefly from the Promptorium
Parvulorum. By ALBERT WAY, Esq., M.A., F.S.A. Vol. II. (M to R.) (In
the Press.)

The following Works are at Press, and will be issued from time to
time, as soon as ready:

Books for 1852-3.

55. THE SECOND VOLUME OF THE CAMDEN MISCELLANY,


containing, 1. Expenses of John of Brabant, 1292-3; 2. Household
Accounts of Princess Elizabeth, 1551-2; 3. Requeste and Suite of a
True-hearted Englishman, by W. Cholmeley, 1553; 4. Discovery of
the Jesuits' College at Clerkenwell, 1627-8; 5. Trelawny Papers; 6.
Autobiography of Dr. William Taswell.—Now ready for delivery to all
Members not in arrear of their Subscription.

56. THE VERNEY PAPERS. A Selection from the Correspondence of


the Verney Family during the reign of Charles I. to the year 1639.
From the Originals in the possession of Sir Harry Verney, Bart. To be
edited by JOHN BRUCE, ESQ., Trea. S.A. (Will be ready immediately.)

57. THE CORRESPONDENCE OF LADY BRILLIANA HARLEY, during


the Civil Wars. To be edited by the REV. T. T. LEWIS, M.A. (Will be
ready immediately.)

ROLL of the HOUSEHOLD EXPENSES of RICHARD SWINFIELD,


Bishop of Hereford, in the years 1289, 1290, with Illustrations from
other and coeval Documents. To be edited by the REV. JOHN WEBB,
M.A., F.S.A.

REGULÆ INCLUSARUM: THE ANCREN REWLE. A Treatise on the


Rules and Duties of Monastic Life, in the Anglo-Saxon Dialect of the
Thirteenth Century, addressed to a Society of Anchorites, being a
translation from the Latin Work of Simon de Ghent, Bishop of
Salisbury. To be edited from MSS. in the Cottonian Library, British
Museum, with an Introduction, Glossarial Notes, &c., by the REV.
JAMES MORTON, B.D., Prebendary of Lincoln.

THE DOMESDAY OF ST. PAUL'S: a Description of the Manors


belonging to the Church of St. Paul's in London in the year 1222. By
the VEN. ARCHDEACON HALE.

ROMANCE OF JEAN AND BLONDE OF OXFORD, by Philippe de


Reims, an Anglo-Norman Poet of the latter end of the Twelfth
Century. Edited, from the unique MS. in the Royal Library at Paris, by
M. LE ROUX DE LINCY, Editor of the Roman de Brut.
Communications from Gentlemen desirous of becoming
Members may be addressed to the Secretary, or to Messrs.
Nichols.
WILLIAM J. THOMS, Secretary.
25. Parliament Street, Westminster.

LORD MAHON'S HISTORY OF ENGLAND.

Now ready, Vol. II. (to be completed in seven vols.), post 8vo., 6s.

A HISTORY OF ENGLAND, From the Peace of Utrecht to the Peace of


Versailles, 1713-1783. By LORD MAHON. Third and revised Edition.
(A Volume to be published every Two Months.)

JOHN MURRAY, Albemarle Street.

THE DEVEREUX EARLS OF ESSEX.

Now ready, with portraits, 2 vols, 8vo., 30s.

LIVES OF THE EARLS OF ESSEX, in the Reigns of Elizabeth, James I.,


and Charles I., 1540-1646. Founded upon many unpublished Private
Letters and Documents. By Capt. the HON. WALTER BOURCHIER
DEVEREUX, R.N.

JOHN MURRAY, Albemarle Street.

Just published, pp. 720, plates 24, price 21s.

A HISTORY OF INFUSORIAL ANIMALCULES, living and fossil, with


Descriptions of all the Species, and Abstracts of the Systems of
Ehrenberg, Dujardin, Kützing, Siebold, &c. By ANDREW PRITCHARD,
ESQ., M.R.I.
Also, price 5s.,

A GENERAL HISTORY OF ANIMALCULES, with 500 Engravings.

Also, price 8s. 6d.,

MICROGRAPHIA, or Practical Essays on Microscopes.

London: WHITTAKER & CO., Ave Maria Lane.

TO ALL WHO HAVE FARMS OR GARDENS.

THE GARDENERS' CHRONICLE AND AGRICULTURAL GAZETTE,

(The Horticultural Part edited by PROF. LINDLEY)

Of Saturday, March 12, contains Articles on

Acrophyllum venosum, by Mr. Barnes


Aphelandra cristata
Asparagus, to salt
Books noticed
Calendar, horticultural
——, agricultural
Carrots, culture of White Belgian, by Mr. Smith
Cattle disease
Cherries, select
Coffee-leaf tea
Coppice wood, value of
Deodar, the, by Mr. Kemp
Drainage, land
Dyes, Lichen, by Dr. Lindsay
Farming, Welsh, by the Rev. T. Williams
Farm buildings, &c.
Flowers, new florist
Fruit trees, stocks for
——, to protect on walls, by Mr. Bundy
Guano, adulteration of
Holland House gardens
Hollyhocks, select, by Mr. Downie
Indian pink, introduction of into Europe
Irrigation and liquid manure, by Mr. Mechi
Ivy, as food for sheep
Level, new, by Mr. Daniels
Lichens, dyeing properties of, by Dr. Lindsay
M‘Glashan's tree lifter (with engravings)
Manure, poultry, by Mr. Tollet
——, liquid, by Mr. Mechi
Mice, to kill, by Mr. Bennett
Mexican oaks and their silkworms
Mustard seed, price of
Onions, preparation of ground for, by Mr. Symons
Peat, carbonised, by Mr. Towers
Railway slopes, planting of
Societies, proceedings of the Botanical of Edinburgh, National
Floricultural, and Agricultural of England
Tea, coffee-leaf
Trade memoranda
Tree lifter, M‘Glashan's (with engravings)
Trout, introduction of to New Zealand, by Mr. Gurney
Tubing, gutta percha, by Mr. Key
Walls, to protect trees on, by Mr. Bundy
Walls, glazed
Weeds and sulphuric acid
Wheat, Lois Weedon system of growing

THE GARDENERS' CHRONICLE and AGRICULTURAL GAZETTE


contains, in addition to the above, the Covent Garden, Mark Lane,
Smithfield, and Liverpool prices, with returns from the Potato, Hop,
Hay, Coal, Timber, Bark, Wool, and Seed Markets, and a complete
Newspaper, with a condensed account of all the transactions of the
week.
ORDER of any Newsvender. OFFICE for Advertisements, 5. Upper
Wellington Street, Covent Garden, London.

AUTOGRAPHS.—Just published, post 8vo., 1s., or Post Free for 12


Stamps, A CATALOGUE of AUTOGRAPH LETTERS, PORTRAITS, &c.

TOPOGRAPHY.—In the Press, will be ready in a few days, price 6d.,


or Post Free for 6 Stamps. A CATALOGUE of BOOKS, PRINTS, MSS.,
&c., on COUNTY and FAMILY HISTORY, HERALDRY, &c.

MISCELLANEOUS CATALOGUES of BOOK AUTOGRAPHS. Parts XXXVI.


to XXXIX. Gratis, or Post Free for 4 Stamps.

London: JOHN GRAY BELL, Bedford Street, Covent Garden.

WANTED, for the Ladies' Institute, 83. Regent Street, Quadrant,


LADIES of taste for fancy work,—by paying 21s. will be received as
members, and taught the new style of velvet wool work, which is
acquired in a few easy lessons. Each lady will be guaranteed
constant employment and ready cash payment for her work. Apply
personally to Mrs. Thoughey. N.B. Ladies taught by letter at any
distance from London.

Printed by Thomas Clark Shaw, of No. 8 New Street Square, at No. 5


New Street Square, in the Parish of St. Bride, in the City of London;
and published by George Bell, of No. 186. Fleet Street, in the Parish
of St. Dunstan in the West, in the City of London, Publisher at No.
186. Fleet Street aforesaid.—Saturday, March 19. 1853.
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about testbank and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebooksecure.com

You might also like