Instant Download Learn PHP 8: Using MySQL, JavaScript, CSS3, and HTML5 Second Edition Steve Prettyman PDF All Chapters
Instant Download Learn PHP 8: Using MySQL, JavaScript, CSS3, and HTML5 Second Edition Steve Prettyman PDF All Chapters
com
https://textbookfull.com/product/learn-php-8-using-mysql-
javascript-css3-and-html5-second-edition-steve-prettyman/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/
textboxfull.com
https://textbookfull.com/product/learning-php-mysql-javascript-with-
jquery-css-html5-5th-edition-robin-nixon/
textboxfull.com
https://textbookfull.com/product/learning-php-mysql-javascript-6th-
edition-robin-nixon/
textboxfull.com
Pro HTML5 Games. Learn to build your own Games using HTML5
and JavaScript Aditya Ravi Shankar
https://textbookfull.com/product/pro-html5-games-learn-to-build-your-
own-games-using-html5-and-javascript-aditya-ravi-shankar/
textboxfull.com
New Perspectives on HTML5, CSS3, and JavaScript 6th
Edition Patric Carey
https://textbookfull.com/product/new-perspectives-on-html5-css3-and-
javascript-6th-edition-patric-carey/
textboxfull.com
https://textbookfull.com/product/learning-php-mysql-javascript-early-
release-6th-edition-robin-nixon/
textboxfull.com
https://textbookfull.com/product/murach-s-html5-and-css3-anne-boehm/
textboxfull.com
https://textbookfull.com/product/responsive-web-design-by-example-
embrace-responsive-design-with-html5-css3-javascript-jquery-and-
bootstrap-4-hussain/
textboxfull.com
Learn PHP 8
Using MySQL, JavaScript, CSS3, and
HTML5
—
Second Edition
—
Steve Prettyman
Learn PHP 8
Using MySQL, JavaScript, CSS3,
and HTML5
Second Edition
Steve Prettyman
Learn PHP 8: Using MySQL, JavaScript, CSS3, and HTML5
Steve Prettyman
Key West, FL, USA
Introduction�����������������������������������������������������������������������������������������������������������xvii
v
Table of Contents
Conditional Statements��������������������������������������������������������������������������������������������������������������� 98
Do It������������������������������������������������������������������������������������������������������������������������������������� 108
Functions���������������������������������������������������������������������������������������������������������������������������������� 109
Do It������������������������������������������������������������������������������������������������������������������������������������� 115
Arrays���������������������������������������������������������������������������������������������������������������������������������������� 116
Do It������������������������������������������������������������������������������������������������������������������������������������� 121
Chapter Terms��������������������������������������������������������������������������������������������������������������������������� 122
Chapter Questions and Projects������������������������������������������������������������������������������������������������ 123
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 419
x
About the Author
Steve Prettyman earned his bachelor of arts degree in education from Oglethorpe
University in 1979. He quickly began his teaching career as a high-school mathematics
instructor while continuing his education by earning a master’s degree in business
information systems from Georgia State University (1985). Since then, Steve has spent
over 30 years in the IT industry. He has also been a professor at Chattahoochee Technical
College, Kennesaw State University, and Southern Polytechnic State University for over
25 years. His primary teaching responsibilities include programming, web design, and
web application development. Steve, his wife Beverly, and their two dogs (Pixee and
Buster) currently reside in Paradise (Key West, Florida).
xi
About the Technical Reviewer
Satej Kumar Sahu works in the role of Senior Enterprise Architect at Honeywell. He is
passionate about technology, people, and nature. He believes through technology and
conscientious decision making, each of us has the power to make this world a better
place. In his free time, he can be seen reading books, playing basketball, and having fun
with friends and family.
xiii
Acknowledgments
Thank you to everyone who has helped put this book together. Special thanks to the
Introduction to PHP classes that have been the true testers and debuggers for this
journey.
Special acknowledgment to all the open source developers and providers of
free tutorials and training to every Internet user who wants to learn more about
programming.
xv
Introduction
Learn PHP 8: Using MySQL, JavaScript, CSS3, and HTML5 is intended for use as a
beginner- and intermediate-level programming book. It is not the goal of this book
to cover advanced techniques in the current versions of the PHP programming
language. Some knowledge of general programming concepts is expected, but no actual
programming experience or education is assumed.
All code examples in this book are compatible with PHP 8. Most examples are
compatible with PHP 7. The newest (as of the publication date) methods (functions)
available in PHP have been used to provide the reader with the most current coding
techniques. The examples use core methods provided in the PHP language. PHP
includes many additional methods to accomplish similar tasks. The reader may,
and should, research additional ways of improving security, performance, and other
techniques. It is the goal of this book to prompt users to always consider using the most
secure and efficient methods of program development. The code in this book provides
some examples of using these techniques. The user should remember that no program
is 100% secure. The programmer can only strive to make an application as secure as
possible. It takes a team of developers, network personnel, security administrators, data
center personnel, and others working together to provide the safest environment.
A Different Approach
There are quite a number of PHP books on the market today. What makes this book any
different than others?
• This book uses the concept of “learning by doing,” which shows the
reader how to develop applications with conditional statements,
loops, arrays, and methods. Over 70 PHP methods (functions) are
introduced and demonstrated in coding examples.
xvii
Introduction
• Object-oriented set methods are used to verify and filter user input.
Many other books simply show a set method accepting data and
storing it.
• The majority of the examples in the book are used to develop one
main application (ABC Canine Shelter Reservation System). As
the book progresses, the application is built from the beginning, in
stages, showing the reader that application development should be
broken into stages. Only after each stage is completed and tested
can the next stage begin. This approach works hand in hand with
multitier design. Additional programming exercises and a term
project are provided to enhance the understanding of development.
• The creation of user, change, and error logs are introduced. This
allows the reader to gain an understanding of how to provide backup
and recovery ability to keep an application functioning properly
when security breaches or exceptions occur.
• The introduction of data objects and the data tier demonstrates to the
reader the importance of creating an application that provides the
ability to change data storage techniques and data storage location
without requiring a major rewrite of the application. XML, JSON, and
MySQL examples are provided.
xviii
Introduction
• Throughout the book, web links are provided to point the user to
additional resources to help understand the material or to dig deeper
into the subject matter. Updates to link locations are provided on the
book’s web site.
C
hapter Overview
C
hapter 1: An Introduction to PHP 8
After completing this chapter, the student will be able to
C
hapter 2: Interfaces, Platforms, and Three-Tier
Programming
After completing this chapter, the student will be able to
C
hapter 3: The Basics: PHP 8 Syntax
After completing this chapter, the student will be able to
• Create a simple, error-free PHP program
• Understand the use and value of for, while, and foreach loops
xx
Introduction
C
hapter 4: Modular Programming
After completing this chapter, the student will be able to
• Import existing PHP code from another file or library into a program
C
hapter 5: Secured User Interfaces
After completing this chapter, the student will be able to
• Explain why user input must be filtered in the business rules tier
xxi
Introduction
C
hapter 6: Handling and Logging Exceptions
After completing this chapter, the student will be able to
• Create a PHP program that can create, raise, and handle user
exceptions
• Create a PHP program that uses the while loop and/or the for loop
C
hapter 7: Data Objects
After completing this chapter, the student will be able to
• Create a data class that inserts, updates, and deletes XML or JSON
data
• Explain how to create a data class that updates MySQL Data using a
SQL Script
• Create a PHP program that can recover data from a previous backup
xxii
Introduction
C
hapter 8: Authentication
After completing this chapter, the student will be able to
• Define sessions and explain how they are used for authentication
• Create a PHP program that will allow users to change their passwords
C
hapter 9: Multifunctional Interfaces
After completing this chapter, the student will be able to
xxiii
CHAPTER 1
An Introduction to PHP 8
PHP is a popular general-purpose scripting language that is especially
suited to web development. Fast, flexible, and pragmatic, PHP powers
everything from your blog to the most popular web sites in the world.
—www.php.net
1
© Steve Prettyman 2020
S. Prettyman, Learn PHP 8, https://doi.org/10.1007/978-1-4842-6240-5_1
Chapter 1 An Introduction to PHP 8
2
Chapter 1 An Introduction to PHP 8
PHP is an open source language. As such, each version of the language is created
using input from the individuals who use it—the programmers themselves. This allows
the language, over time, to evolve and float into the direction that is driven by the users.
From its first release in 1995 as a Personal Home Page Tool (PHP) by Rasmus Lerdorf, the
versions have been released on the Internet with forums to provide users the ability to
make suggestions and even provide code changes and additions. Today, www.php.net is
the official PHP web site.
The www.php.net home page provides information on each of the latest releases of
the language. It also provides information on future releases, the features planned for
those releases, and the planned release dates. In addition, other related PHP information
can be found, including links and information to major PHP conferences.
3
Chapter 1 An Introduction to PHP 8
The download page, as you might have guessed, provides the ability to gain easy
access to the latest versions of the language. However, as you will note, only the language
itself is provided. It is more common, and recommended, that the beginning user use
a WAMP (Windows, Apache, MySQL/MariaDB, PHP), LAMP (Linux, Apache, MySQL/
MariaDB, PHP), or MAMP (Mac, Apache, MySQL/MariaDB, PHP) stack package for initial
installation. These packages (which we will look at later) allow for easy installation of
multiple products at the same time. Otherwise, you have to run many separate installations.
4
Chapter 1 An Introduction to PHP 8
One of the more important pages of the PHP web site is the documentation page.
This page allows users to search for descriptions and functionality of the language itself.
You can also download the complete documentation. However, since this is a “live”
site, with possible changes occurring, the most current information is best obtained by
directly accessing it from the web site.
5
Chapter 1 An Introduction to PHP 8
You can use the manual as if it were a textbook by clicking through each link from
the beginning. The limited amount of explanation provided with each section of the
manual might cause a beginner to want to give up on programming and change interests
to something ghastly like networking! The manual does provide a great guide for
experienced programmers, as the syntax of the language is similar to other languages
such as Python, JavaScript, Perl, and Java.
On any page of the web site, the user can enter a term, an expression, or even a
function name to find more information. As the information is entered in search box, the
web page will provide the user with one or more options below the box for the user to
select.
6
Chapter 1 An Introduction to PHP 8
Once the user has selected an option (such as echo shown in Figure 1-7), the results
of the search provide the user with a general description of the item requested, any
inputs or outputs for a function (parameters), and example code.
The example code provides explanations of the use of the function within the
code itself by using comments (indicated by the // and gold color in Figure 1-8). The
comments are not executable code. The executable code is color-coded to highlight
strings (red), variables (blue), keywords (green), and the PHP opening and closing tags
(blue). Color-coding helps make the code more readable. It also can make it easier to
find syntax errors when creating programs. Many PHP editors provide similar color
schemes.
PHP 7 is based on the PHPNG project (PHP Next-Gen), that was led by
Zend to speed up PHP applications. The performance gains realized from
PHP 7 are huge! They vary between 25% and 70% on real-world apps, and
all of that just from upgrading PHP, without having to change a single line
of code!
—www.zend.com
7
Chapter 1 An Introduction to PHP 8
PHP 7 also replaces fatal errors, which previously would crash a program, with
exceptions that can be handled within the program itself. PHP 7 added many additional
features, including type declarations for classes and functions, and a spaceship operator.
In addition to bug fixes and security enhancements, PHP 7.4 introduced the spread
operator which provides much better performance for merging arrays than array_
merge. The preload of functions and classes available in PHP 7.4 greatly increases PHP
performance on heavy used systems. Any preloaded items are already resident in the
web server and can immediately be executed. They stay resident as long as the sever
is running. Arrow functions have been introduced to provide easier use of anonymous
functions. Type declarations in class properties have also been improved and expanded.
The order of preference for concatenation of strings and numbers has been adjusted to
reduce error situations.
<?php
$num1 = 1;
$num2 = 2;
echo "Hello " . $num1 + $num2;
?>
Before PHP 7.5, this statement would produce a nonnumeric value error when
evaluated from left to right. After PHP 7.5, the two values on the right ($num1 and
$num2) are first added and then the resulting number and string will be concatenated to
produce
“Hello 3”
With the rollout of 5G Internet speeds and real-time results promised by our ISP
providers, PHP must again increase speed and performance. While PHP 7 and PHP
7.4 greatly improved execution times over previous versions, PHP developers of large-
scale systems, like Facebook, demanded even more efficiencies. Before PHP 8, these
developers had to decide between compiling PHP 7 as it was originally designed and
using Facebook’s HHVM (Hip Hop Virtual Machine) which converts PHP code into C++
code which can then be executed for better performance.
With the introduction of PHP 8, code is compiled using a JIT (just-in-time) compiler.
This technique has been used for many years in other languages, such as Java. Code
compiled with JIT will initially be transformed into opcode. When the opcode is
executed, it transitions into executable machine-level code. This change in combination
with the preloaded classes and functions introduced in PHP 7.4 dramatically increases
8
Chapter 1 An Introduction to PHP 8
code efficiency and speed. So much so that some developers may now begin to look at
using PHP for more than just web applications! Game developers may finally look at PHP
as a legit development platform!
In addition, PHP 8 introduces union types and static return types. It builds upon PHP
7.4’s introduction of weak references and allows a weakmap relationship with objects
to allow them to remain in memory without being destroyed by the server’s garbage
collector. The str_contains function (finally) allows us to search more efficiently for
contents in a string. Internal function errors now behave in the same way as user-defined
function errors. The @ operator, which you may have seen in older PHP code, is removed.
To stop errors from being displayed, you must set this feature within your server.
If you are migrating from a previous version of PHP to PHP 8, please review the
migration notes in the appendix of the online manual:
http://php.net/manual/
The code used in the examples in this book are compatible with PHP 8. Most
examples are also compatible with PHP 7 and PHP 7.4.
D
o It
1. Go to www.php.net. Search for information on the print and
printf functions. How are these functions similar? How are they
different?
2. How do you “join the team” and help with the creation of the next
version of PHP? Hint: Go to www.php.net and search for the
answer.
9
Another Random Scribd Document
with Unrelated Content
CHAPTER IV
In May it happened that Uncle Gotthold—Consul Gotthold
Buddenbrook, now sixty years old—was seized with a heart attack
one night and died in the arms of his wife, born Stüwing.
The son of poor Madame Josephine had had the worst of it in life,
compared with the younger and stronger brother and sister born of
Madame Antoinette. But he had long since resigned himself to his
fortunes; and in his later years, especially after his nephew turned
over to him the Consulate of the Netherlands, he ate his lozenges
out of his tin box and harboured the friendliest feelings. It was his
ladies who kept up the feud now: not so much his good-natured wife
as the three elderly damsels, who could not look at Frau Consul, or
Antonie, or Thomas, without a spark in their eyes.
On the traditional “children’s day,” at four o’clock, they all gathered in
the big house in Meng Street, to eat dinner and spend the evening.
Sometimes Consul Kröger or Sesemi Weichbrodt came too, with her
simple sister. On these occasions the three Miss Buddenbrooks from
Broad Street loved to turn the conversation to Tony’s former
marriage and to dart sharp glances at each other while they egged
Madame Grünlich on to use strong language. Or they would make
general remarks on the subject of the undignified vanity of dyeing
one’s hair. Or they would enquire particularly after Jacob Kröger, the
Frau Consul’s nephew. They made jokes at the expense of poor,
innocent, Clothilde—jokes not so harmless as those which the
charity girl received in good part every day from Tom and Tony. They
made fun of Clara’s austerity and bigotry. They were quick to find out
that Tom and Christian were not on the best of terms; also, that they
did not need to pay much attention to Christian anyhow, for he was a
sort of Tom-fool. As for Thomas himself, who had no weak point for
them to ferret out, and who always met them with a good-humoured
indulgence, that signified “I understand what you mean, and I am
very sorry”—him they treated with respect tinctured with bitterness.
Next came the turn of little Erica. Rosy and plump as she was, they
found her alarmingly backward in her growth. And Pfiffi in a series of
little shakes drew attention several times to the child’s shocking
resemblance to the deceiver Grünlich.
But now they stood with their mother about their Father’s death-bed,
weeping; and a message was sent to Meng Street, though the
feeling was not entirely wanting that their rich relations were
somehow or other to blame for this misfortune too.
In the middle of the night the great bell downstairs rang; and as
Christian had come home very late and was not feeling up to much,
Tom set out alone in the spring rain.
He came just in time to see the last convulsive motions of the old
gentleman. Then he stood a long time in the death-chamber and
looked at the short figure under the covers, at the dead face with the
mild features and white whiskers. “You haven’t had a very good time,
Uncle Gotthold,” he thought. “You learned too late to make
concessions and show consideration. But that is what one has to do.
If I had been like you, I should have married a shop girl years ago.
But for the sake of appearances—! I wonder if you really wanted
anything different? You were proud, and probably felt that your pride
was something idealistic; but your spirit had little power to rise. To
cherish the vision of an abstract good; to carry in your heart, like a
hidden love, only far sweeter, the dream of preserving an ancient
name, an old family, an old business, of carrying it on, and adding to
it more and more honour and lustre—ah, that takes imagination,
Uncle Gotthold, and imagination you didn’t have. The sense of
poetry escaped you, though you were brave enough to love and
marry against the will of your father. And you had no ambition, Uncle
Gotthold. The old name is only a burgher name, it is true, and one
cherishes it by making the grain business flourish, and oneself
beloved and powerful in a little corner of the earth. Did you think: ‘I
will marry her whom I love, and pay no attention to practical
considerations, for they are petty and provincial?’ Oh, we are
travelled and educated enough to realize that the limits set to our
ambition are small and petty enough, looked at from outside and
above. But everything in this world is comparative, Uncle Gotthold.
Did you know one can be a great man, even in a small place; a
Cæsar even in a little commercial town on the Baltic? But that takes
imagination and idealism—and you didn’t have it, whatever you may
have thought yourself.”
Thomas Buddenbrook turned away. He went to the window and
looked out at the dim grey gothic façade of the Town Hall opposite,
shrouded in rain. He had his hands behind his back and a smile on
his intelligent face.
The office and title of the Royal Consulate of the Netherlands, which
Thomas Buddenbrook might have taken after his father’s death,
went back to him now, to the boundless satisfaction of Tony Grünlich;
and the curving shield with the lions, the arms, and the crown was
once more to be seen on the gabled front of the house in Meng
Street, under the “Dominus providebit.”
Soon after this was accomplished, in June of the same year, the
young Consul set out to Amsterdam on a business journey the
duration of which he did not know.
CHAPTER V
Deaths in the family usually induce a religious mood. It was not
surprising, after the decease of the Consul, to hear from the mouth
of his widow expressions which she had not been accustomed to
use.
But it was soon apparent that this was no passing phase. Even in the
last years of the Consul’s life, his wife had more and more
sympathized with his spiritual cravings; and it now became plain that
she was determined to honour the memory of her dead by adopting
as her own all his pious conceptions.
She strove to fill the great house with the spirit of the deceased—that
mild and Christlike spirit which yet had not excluded a certain
dignified and hearty good cheer. The morning and evening prayers
were continued and lengthened. The family gathered in the dining-
room, and the servants in the hall, to hear the Frau Consul or Clara
read a chapter out of the great family Bible with the big letters. They
also sang a few verses out of the hymn-book, accompanied by the
Frau Consul on the little organ. Or, often, in place of the chapter from
the Bible, they had a reading from one of those edifying or devotional
books with the black binding and gilt edges—those Little Treasuries,
Jewel-Caskets, Holy Hours, Morning Chimes, Pilgrims’ Staffs, and
the like, whose common trait was a sickly and languishing
tenderness for the little Jesus, and of which there were all too many
in the house.
Christian did not often appear at these devotions. Thomas once
chose a favourable moment to disparage the practice, half-jestingly;
but his objection met with a gentle rebuff. As for Madame Grünlich,
she did not, unfortunately, always conduct herself correctly at the
exercises. One morning when there was a strange clergyman
stopping with the Buddenbrooks, they were invited to sing to a
solemn and devout melody the following words:—
I am a reprobate,
A warped and hardened sinner;
I gobble evil down
Just like the joint for dinner.
Lord, fling thy cur a bone
Of righteousness to chew
And take my carcass home
To Heaven and to you.
Whereat Frau Grünlich threw down her book and left the room,
bursting with suppressed giggles.
But the Frau Consul made more demands upon herself than upon
her children. She instituted a Sunday School, and on Sunday
afternoon only little board-school pupils rang at the door of the house
in Meng Street. Stine Voss, who lived by the city wall, and Mike Stuht
from Bell-Founders’ Street, and Fike Snut from the river-bank or
Groping Alley, their straw-coloured locks smoothed back with a wet
comb, crossed the entry into the garden-room, which for a long time
now had not been used as an office, and in which rows of benches
had been arranged and Frau Consul Buddenbrook, born Kröger, in a
gown of heavy black satin, with her white refined face and still whiter
lace cap, sat opposite to them at a little table with a glass of sugar-
water and catechized them for an hour.
Also, she founded the “Jerusalem evenings,” which not only Clara
and Clothilde but also Tony were obliged to attend, willy-nilly. Once a
week they sat at the extension-table in the dining-room by the light of
lamps and candles. Some twenty ladies, all of an age when it is
profitable to begin to look after a good place in heaven, drank tea or
bishop, ate delicate sandwiches and puddings, read hymns and
sermons aloud to each other, and did embroidery, which at the end
of the year was sold at a bazaar and the proceeds sent to the
mission in Jerusalem.
This pious society was formed in the main from ladies of the Frau
Consul’s own social rank: Frau Senator Langhals, Frau Consul
Möllendorpf, and old Frau Consul Kistenmaker belonged; but other,
more worldly and profane old ladies, like Mme. Köppen, made fun of
their friend Betsy. The wives of the clergymen of the town were all
members, likewise the widowed Frau Consul Buddenbrook, born
Stüwing, and Sesemi Weichbrodt and her simple sister. There is,
however, no rank and no discrimination before Jesus; and so certain
humble oddities were also guests at the Jerusalem evenings—for
example, a little wrinkled creature, rich in the grace of God and
knitting-patterns, who lived in the Holy Ghost Hospital and was
named Himmelsburger. She was the last of her name—“the last
Himmelsburger,” she called herself humbly, and ran her knitting-
needle under her cap to scratch her head.
But far more remarkable were two other extraordinary old creatures,
twins, who went about hand in hand through the town doing good
deeds, in shepherdess hats out of the eighteenth century and faded
clothes out of the long, long ago. They were named Gerhardt, and
asserted that they descended in a direct line from Paul Gerhardt.
People said they were by no means poor; but they lived wretchedly
and gave away all they had. “My dears,” remarked the Frau Consul,
who was sometimes rather ashamed of them, “God sees the heart, I
know; but your clothes are really a little—one must take some
thought for oneself.” But she could not prevent them kissing their
elegant friend on the brow with the forebearing, yearning, pitying
superiority of the poor in heart over the worldly great who seek
salvation. They were not at all stupid. In their homely shrivelled
heads—for all the world like ancient parrots—; they had bright soft
brown eyes and they looked out at the world with a wonderful
expression of gentleness and understanding. Their hearts were full
of amazing wisdom. They knew that in the last day all our beloved
gone before us to God will come with song and salvation to fetch us
home. They spoke the words “the Lord” with the fluent authority of
early Christians, as if they had heard out of the Master’s own mouth
the words, “Yet a little while and ye shall see me.” They possessed
the most remarkable theories concerning inner light and intuition and
the transmission of thought. One of them, named Lea, was deaf, and
yet she nearly always knew what was being talked about!
It was usually the deaf Gerhardt who read aloud at the Jerusalem
evenings, and the ladies found that she read beautifully and very
affectingly. She took out of her bag an old book of a very
disproportionate shape, much taller than it was broad, with an
inhumanly chubby presentment of her ancestor in the front. She held
it in both hands and read in a tremendous voice, in order to catch a
little herself of what she read. It sounded as if the wind were
imprisoned in the chimney:
“If Satan me would swallow.”
“Goodness!” thought Tony Grünlich, “how could Satan want to
swallow her?” But she said nothing and devoted herself to the
pudding, wondering if she herself would ever become as ugly as the
two Miss Gerhardts.
She was not happy. She felt bored and out of patience with all the
pastors and missionaries, whose visits had increased ever since the
death of the Consul. According to Tony they had too much to say in
the house and received entirely too much money. But this last was
Tom’s affair, and he said nothing, while his sister now and then
murmured something about people who consumed widows’ homes
and made long prayers.
She hated these black gentlemen bitterly. As a mature woman who
knew life and was no longer a silly innocent, she found herself
unable to believe in their irreproachable sanctity. “Mother,” she said,
“oh dear, I know I must not speak evil of my neighbours. But one
thing I must say, and I should be surprised if life had not taught you
that too, and that is that not all those who wear a long coat and say
‘Lord, Lord’ are always entirely without blemish.”
History does not say what Tom thought of his sister’s opinion on this
point. Christian had no opinion at all. He confined himself to
watching the gentlemen with his nose wrinkled up, in order to imitate
them afterward at the club or in the family circle.
But it is true that Tony was the chief sufferer from the pious visitants.
One day it actually happened that a missionary named Jonathan,
who had been in Arabia and Syria—a man with great, reproachful
eyes and baggy cheeks was stopping in the house, and challenged
her to assert that the curls she wore on her forehead were consistent
with true Christian humility. He had not reckoned with Tony
Grünlich’s skill at repartee. She was silent a moment, while her mind
worked rapidly; and then out it came. “May I ask you, Herr Pastor, to
concern yourself with your own curls?” With that she rustled out,
shoulders up, head back, and chin well tucked in. Pastor Jonathan
had very few curls on his head—it would be nearer truth to say that
he was quite bald.
And once she had an even greater triumph. There was a certain
Pastor Trieschke from Berlin. His nickname was Teary Trieschke,
because every Sunday he began to weep at an appropriate place in
his sermon. Teary Trieschke had a pale face, red eyes, and cheek-
bones like a horse’s. He had been stopping for eight or ten days with
the Buddenbrooks, conducting devotions and holding eating contests
with poor Clothilde, turn about. He happened to fall in love with Tony
—not with her immortal soul, oh no, but with her upper lip, her thick
hair, her pretty eyes and charming figure. And the man of God, who
had a wife and numerous children in Berlin, was not ashamed to
have Anton leave a letter in Madame Grünlich’s bedroom in the
upper storey, wherein Bible texts and a kind of fawning
sentimentality were surpassingly mingled. She found it when she
went to bed, read it, and went with a firm step downstairs into the
Frau Consul’s bedroom, where by the candle-light she read aloud
the words of the soul-saver to her Mother, quite unembarrassed and
in a loud voice; so that Teary Trieschke became impossible in Meng
Street.
“They are all alike,” said Madame Grünlich; “ah, they are all alike.
Oh, heavens, what a goose I was once! But life has destroyed my
faith in men. Most of them are scoundrels—alas, it is the truth.
Grünlich—” The name was, as always, like a summons to battle. She
uttered it with her shoulders lifted and her eyes rolled up.
CHAPTER VI
Sievert Tiburtius was a small, narrow man with a large head and a
thin, long, blond beard parted in the middle, so that he sometimes
put the ends back over his shoulders. A quantity of little woolly
ringlets covered his round head. His ears were large and
outstanding, very much curled up at the edges and pointed at the
tips like the ears of a fox. His nose sat like a tiny flat button in his
face, his cheek-bones stood out, and his grey eyes, usually drawn
close together and blinking about rather stupidly, could at certain
moments widen quite extraordinarily, and get larger and larger,
protruding more and more until they almost sprang out of their
sockets.
This Pastor Tiburtius, who came from Riga, had preached for some
years in central Germany, and now touched at the town on his way
back home, where a living had been offered to him. Armed with the
recommendation of a brother of the cloth who had eaten at least
once in Meng Street of mock-turtle soup and ham with onion sauce,
he waited upon the Frau Consul and was invited to be her guest for
a few days. He occupied the spacious guest-chamber off the corridor
in the first storey. But he stopped longer than he had expected. Eight
days passed, and still there was this or that to be seen: the dance of
death and the apostle-clock in St. Mary’s, the Town Hall, the ancient
Ships’ Company, the Cathedral clock with the movable eyes. Ten
days passed, and he spoke repeatedly of his departure, but at the
first word of demur from anybody would postpone anew.
He was a better man than Herr Jonathan or Teary Trieschke. He
thought not at all about Frau Antonie’s curls and wrote her no letters.
Strange to say, he paid his attentions to Clara, her younger and
more serious sister. In her presence, when she spoke, entered or left
the room, his eyes would grow surprisingly larger and larger and
open out until they nearly jumped out of his head. He would spend
almost the entire day in her company, in spiritual or worldly converse
or reading aloud to her in his high voice and with the droll, jerky
pronunciation of his Baltic home.
Even on the first day he said: “Permit me to say, Frau Consul, what a
treasure and blessing from God you have in your daughter Clara.
She is certainly a wonderful child.”
“You are right,” replied the Frau Consul. But he repeated his opinion
so often that she began looking him over with her pale-blue eyes,
and led him on to speak of his home, his connections, and his
prospects. She learned that he came of a mercantile family, that his
mother was with God, that he had no brothers and sisters, and that
his old father had retired and lived on his income in Riga—an income
which would sometime fall to him, Pastor Tiburtius. He also had a
sufficient living from his calling.
Clara Buddenbrook was now in her nineteenth year. She had grown
to be a young lady of an austere and peculiar beauty, with a tall,
slender figure, dark, smooth hair, and stern yet dreamy eyes. Her
nose was slightly hooked, her mouth a little too firmly closed. In the
household she was most intimate with her poor and pious cousin
Clothilde, whose father had lately died, and whose idea it was to
“establish herself” soon—which meant to go into a pension
somewhere with the money and furniture which she had inherited.
Clara had nothing of Clothilde’s meek and hungry submissiveness.
On the contrary, with the servants and even with her brothers and
sister and mother, a commanding tone was usual with her. Her low
voice, which seemed only to drop with decision and never to rise
with a question, had an imperious sound and could often take on a
short, hard, impatient, haughty quality—on days, for example, when
Clara had a headache.
Before the father’s death had shrouded the family in mourning, she
had taken part with irreproachable dignity in the society of her
parents’ house and other houses of like rank. But when the Frau
Consul looked at her, she could not deny that, despite the stately
dowry and Clara’s domestic prowess, it would not be easy to marry
her off. None of the godless, jovial, claret-drinking merchants of their
circle would answer in the least; a clergyman would be the only
suitable partner for this earnest and God-fearing maiden. After the
Frau Consul had conceived this joyful idea, she responded with
friendliness to the delicate advances of Pastor Tiburtius.
And truly the affair developed with precision. On a warm, cloudless
July afternoon the family took a walk: the Frau Consul, Antonie,
Christian, Clara, Clothilde, Erica Grünlich, and Mamsell Jungmann,
with Pastor Tiburtius in their midst, went out far beyond the Castle
Gate to eat strawberries and clotted milk or porridge at a wooden
table laid out-of-doors, going after the meal into the large nut-garden
which ran down to the river, in the shade of all sorts of fruit-trees,
between currant and gooseberry bushes, asparagus and potato
patches.
Sievert Tiburtius and Clara Buddenbrook stopped a little behind the
others. He, much the smaller of the two, with his beard parted back
over his shoulders, had taken off his broad-brimmed black hat from
his big head; and he wiped his brow now and then with his
handkerchief. His eyes were larger than usual and he carried on with
her a long and gentle conversation, in the course of which they both
stood still, and Clara, with a serious, calm voice said her “Yes.”
After they returned, the Frau Consul, a little tired and overheated,
was sitting alone in the landscape-room, when Pastor Tiburtius came
and sat beside her. Outside there reigned the pensive calm of the
Sabbath afternoon; and they sat inside and held, in the brightness of
the summer evening, a long, low conversation, at the end of which
the Frau Consul said: “Enough, my dear Herr Pastor. Your offer
coincides with my motherly plans for my daughter; and you on your
side have not chosen badly—that I can assure you. Who would have
thought that your coming and your stay here in our house would be
so wonderfully blest! I will not speak my final word to-day, for I must
write first to my son, the Consul, who is at present, as you know,
away. You will travel to-morrow, if you live and have your health, to
Riga, to take up your work; and we expect to go for some weeks to
the seashore. You will receive word from me soon, and God grant
that we shall have a happy meeting.”
CHAPTER VII
Amsterdam, July 30th, 1856
hotel het hassje
My dear Mother,
I have just received your important letter, and hasten to
thank you for the consideration you show me in asking for
my consent in the affair under discussion. I send you, of
course, not only my hearty agreement, but add my
warmest good-wishes, being thoroughly convinced that
you and Clara have made a good choice. The fine name
Tiburtius is known to me, and I feel sure that Papa had
business relations with the father. Clara comes into
pleasant connections, in any case, and the position as
pastor’s wife will be very suited to her temperament.
And Tiburtius has gone back to Riga, and will visit his
bride again in August? Well, it will be a gay time then with
us in Meng Street—gayer than you realize, for you do not
know the reason why I was so joyfully surprised by
Mademoiselle Clara’s betrothal, nor what a charming
company it is likely to be. Yes, my dear good Mother: I am
complying with the request to send my solemn consent to
Clara’s betrothal from the Amstel to the Baltic. But I do so
on condition that you send me a similar consent by return
of post! I would give three solid gulden to see your face,
and even more that of our honest Tony, when you read
these lines. But I will come to the point.
My clean little hotel is in the centre of the town with a
pretty view of the canal. It is not far from the Bourse; and
the business on which I came here—a question of a new
and valuable connection, which you know I prefer to look
after in person—has gone successfully from the first day. I
have still considerable acquaintance here from the days of
my apprenticeship; so, although many families are at the
shore now, I have been invited out a good deal. I have
been at small evening companies at the Van Henkdoms
and the Moelens, and on the third day after my arrival I
had to put on my dress clothes to go to a dinner at the
house of my former chief, van der Kellen, which he had
arranged out of season in my honour. Whom did I take in
to dinner? Should you like to guess? Fräulein Arnoldsen,
Tony’s old school-fellow. Her father, the great merchant
and almost greater violin artist, and his married daughter
and her husband were also of the party.
I well remember that Gerda—if I may call her so—from the
beginning, even when she was a young girl at school at
Fräulein Weichbrodt’s on the Millbrink, made a strong
impression on me, never quite obliterated. But now I saw
her again, taller, more developed, lovelier, more animated.
Please spare me a description, which might so easily
sound overdrawn—and you will soon see each other face
to face.
You can imagine we had much to talk about at the table,
but we had left the old memories behind by the end of the
soup, and went on to more serious and fascinating
matters. In music I could not hold my own with her, for we
poor Buddenbrooks know all too little of that, but in the art
of the Netherlands I was more at home, and in literature
we were fully agreed.
Truly the time flew. After dinner I had myself presented to
old Herr Arnoldsen, who received me with especial
cordiality. Later, in the salon, he played several concert
pieces, and Gerda also performed. She looked wonderful
as she played, and although I have no notion of violin
playing, I know that she knew how to sing upon her
instrument (a real Stradivarius) so that the tears nearly
came into my eyes. Next day I went to call on the
Arnoldsens. I was received at first by an elderly
companion, with whom I spoke French, but then Gerda
came, and we talked as on the day before for perhaps an
hour, only that this time we drew nearer together and
made still more effort to understand and know each other.
The talk was of you, Mamma, of Tony, of our good old
town, and of my work.
And on that day I had already taken the firm resolve: this
one or no one, now or never! I met her again by chance at
a garden party at my friend van Svindren’s, and I was
invited to a musical evening at the Arnoldsens’, in the
course of which I sounded the young lady by a half-
declaration, which was received encouragingly. Five days
ago I went to Herr Arnoldsen to ask for permission to win
his daughter’s hand. He received me in his private office.
“My dear Consul,” he said, “you are very welcome, hard as
it will be for an old widower to part from his daughter. But
what does she say? She has already held firmly to her
resolve never to marry. Have you a chance?” He was
extremely surprised when I told him that Fräulein Gerda
had actually given me ground for hope.
He left her some time for reflection, and I imagine that out
of pure selfishness he dissuaded her. But it was useless.
She had chosen me—since yesterday evening the
betrothal is an accomplished fact.
No, my dear Mother, I am not asking a written answer to
this letter, for I am leaving to-morrow. But I am bringing
with me the Arnoldsens’ promise that father, daughter, and
married sister will visit us in August, and then you will be
obliged to confess that she is the very wife for me. I hope
you see no objection in the fact that Gerda is only three
years younger than I? I am sure you never thought I would
marry a chit out of the Möllendorpf-Langhals,
Kistenmaker-Hagenström circle.
And now for the dowry. I am almost frightened to think how
Stephan Kistenmaker and Hermann Hagenström and
Peter Döhlmann and Uncle Justus and the whole town will
blink at me when they hear of the dowry. For my future
father-in-law is a millionaire. Heavens, what is there to
say? We are such complex, contradictory creatures! I
deeply love and respect Gerda Arnoldsen; and I simply
will not delve deep down enough in myself to find out how
much the thought of the dowry, which was whispered into
my ear that first evening, contributed to my feeling. I love
her: but it crowns my happiness and pride to think that
when she becomes mine, our firm will at the same time
gain a very considerable increase of capital.
I must close this letter, dear Mother; considering that in a
few days, we shall be talking over my good fortune
together, it is already too long. I wish you a pleasant and
beneficial stay at the baths, and beg you to greet all the
family most heartily for me. Your loving and obedient son,
T.
CHAPTER VIII
That year there was indeed a merry midsummer holiday in the
Buddenbrook home. At the end of July Thomas returned to Meng
Street and visited his family at the shore several times, like the other
business men in the town. Christian had allotted full holidays unto
himself, as he complained of an indefinite ache in his left leg. Dr.
Grabow did not seem to treat it successfully, and Christian thought of
it so much the more.
“It is not a pain—one can’t call it a pain,” he expatiated, rubbing his
hand up and down his leg, wrinkling his big nose, and letting his
eyes roam about. “It is a sort of ache, a continuous, slight, uneasy
ache in the whole leg and on the left side, the side where the heart
is. Strange. I find it strange—what do you think about it, Tom?”
“Well, well,” said Tom, “you can have a rest and the sea-baths.”
So Christian went down to the shore to tell stories to his fellow-
guests, and the beach resounded with their laughter. Or he played
roulette with Peter Döhlmann, Uncle Justus, Dr. Gieseke, and other
Hamburg high-fliers.
Consul Buddenbrook went with Tony, as always when they were in
Travemünde, to see the old Schwarzkopfs on the front. “Good day,
Ma’am Grünlich,” said the pilot-captain, and spoke low German out
of pure good feeling.
“Well, well, what a long time ago that was! And Morten, he’s a doctor
in Breslau and has all the practice in the town, the rascal.” Frau
Schwarzkopf ran off and made coffee, and they supped in the green
verandah as they used to—only all of them were a good ten years
older, and Morten and little Meta were not there, she having married
the magistrate of Haffkrug. And the captain, already white-haired and
rather deaf, had retired from his office—and Madame Grünlich was
not a goose any more! Which did not prevent her from eating a great
many slices of bread and honey, for, as she said: “Honey is a pure
nature product—one knows what one is getting.”
At the beginning of August the Buddenbrooks, like most of the other
families, returned to town; and then came the great moment when,
almost at the same time, Pastor Tiburtius from Prussia and the
Arnoldsens from Holland arrived for a long visit in Meng Street.
It was a very pretty scene when the Consul led his bride for the first
time into the landscape-room and took her to his mother, who
received her with outstretched arms. Gerda had grown tall and
splendid. She walked with a free and gracious bearing; with her
heavy dark-red hair, her close-set brown eyes with the blue shadows
round them, her large, gleaming teeth which showed when she
smiled, her straight strong nose and nobly formed mouth, this
maiden of seven-and-twenty years had a strange, aristocratic,
haunting beauty. Her face was white and a little haughty, but she
bowed her head as the Frau Consul with gentle feeling took it
between her hands and kissed the pure, snowy forehead. “Yes, you
are welcome to our house and to our family, you dear, beautiful,
blessed creature,” she said. “You will make him happy. Do I not see
already how happy you make him?” And she drew Thomas forward
with her other arm, to kiss him also.
Never, except perhaps in Grandfather’s time, was there more gay
society in the great house, which accommodated its guests with
ease. Pastor Tiburtius had modestly chosen a bed-chamber in the
back building next the billiard-room. But the rest divided the
unoccupied space on the ground floor next the hall and in the first
storey: Gerda; Herr Arnoldsen, a quick, clever man at the end of the
fifties, with a pointed grey beard and a pleasant impetuosity in every
motion; his oldest daughter, an ailing-looking woman; and his son-in-
law, an elegant man of the world, who was turned over to Christian
for entertainment in the town and at the club.
Antonie was overjoyed that Sievert Tiburtius was the only parson in
the house. The betrothal of her adored brother rejoiced her heart.
Aside from Gerda’s being her friend, the parti was a brilliant one,
gilding the family name and the firm with such new glory! And the
three-hundred-thousand mark dowry and the thought of what the
town and particularly the Hagenströms would say to it, put her in a
state of prolonged and delightful enchantment. Three times daily, at
least, she passionately embraced her future sister-in-law.
“Oh, Gerda,” she cried, “I love you—you know I always did love you.
I know you can’t stand me—you used to hate me; but—”
“Why, Tony!” said Fräulein Arnoldsen. “How could I have hated you?
Did you ever do anything to me?” For some reason, however—
probably out of mere wantonness and love of talking—Tony asserted
stoutly that Gerda had always hated her, while she on her side had
always returned the hate with love. She took Thomas aside and told
him: “You have done very well, Tom. Oh, heavens, how well you
have done! If Father could only see this—it is just dreadful that he
cannot! Yes, this wipes out a lot of things—not least the affair with
that person whose name I do not even like to speak.”
Which put it into her head to take Gerda into an empty room and tell
her with awful detail the story of her married life with Bendix
Grünlich. Then they talked for hours about boarding-school days and
the bed-time gossip; of Armgard von Schilling in Mecklenburg and
Eva Ewers in Munich. Tony paid little or no attention to Sievert
Tiburtius and his betrothed—which troubled them not at all. The
lovers sat quietly together hand in hand, and spoke gently and
earnestly of the beautiful future before them.
As the year of mourning was not quite over, the two betrothals were
celebrated only in the family. But Gerda quickly became a celebrity in
the town. Her person formed the chief subject of conversation on the
Bourse, at the club, at the theatre, and in society. “Tip-top,” said the
gallants, and clucked their tongues, for that was the latest Hamburg
slang for a superior article, whether a brand of claret, a cigar, or a
“deal.” But among the solid, respectable citizens there was much
head-shaking. “Something queer about her,” they said. “Her hair, her
face, the way she dresses—a little too unusual.” Sorenson
expressed it: “She has a certain something about her!” He made a
face as if he were on the Bourse and somebody had made him a
doubtful proposition. But it was all just like Consul Buddenbrook: a
little pretentious, not like his forebears. Everybody knew—not least
Benthien the draper—that he ordered his clothes from Hamburg: not
only the fine new-fashioned materials for his suits—and he had a
great many of them, cloaks, coats, waistcoats, and trousers—but his
hats and cravats and linen as well. He changed his shirt every day,
sometimes twice a day, and perfumed his handkerchief and his
moustache, which he wore cut like Napoleon III. All this was not for
the sake of the firm, of course—the house of Johann Buddenbrook
did not need that sort of thing—but to gratify his own personal taste
for the superfine and aristocratic—or whatever you might call it. And
then the quotations from Heine and other poets which he dropped
sometimes in the most practical connections, in business or civic
matters! And now, his bride—well, Consul Buddenbrook himself had
“a certain something” about him! All this, of course, with the greatest
respect; for the family was highly esteemed, the firm very, very
“good,” and the head of it an able and charming man who loved his
city and would still serve her well. It was really a devilishly fine match
for him; there was talk of a hundred thousand thaler down; but of
course.... Among the ladies there were some who found Gerda
“silly”; which, it will be recalled, was a very severe judgment.
But the man who gazed with furious ardour at Thomas
Buddenbrook’s bride, the first time he saw her on the street, was
Gosch the broker. “Ah!” he said in the club or the Ships’ Company,
lifting his glass and screwing up his face absurdly, “what a woman!
Hera and Aphrodite, Brunhilda and Melusine all in one! Oh, how
wonderful life is!” he would add. And not one of the citizens who sat
about with their beer on the hard wooden benches of the old guild-
house, under the models of sailing vessels and big stuffed fish
hanging down from the ceiling, had the least idea what the advent of
Gerda Arnoldsen meant in the yearning life of Gosch the broker.
The little company in Meng Street, not committed, as we have seen,
to large entertainments, had the more leisure for intimacy with each
other. Sievert Tiburtius, with Clara’s hand in his, talked about his
parents, his childhood, and his future plans. The Arnoldsens told of
their people, who came from Dresden, only one branch of them
having been transplanted to Holland.
Madame Grünlich asked her brother for the key of the secretary in
the landscape-room, and brought out the portfolio with the family
papers, in which Thomas had already entered the new events. She
proudly related the Buddenbrook history, from the Rostock tailor on;
and when she read out the old festival verses:
Industry and beauty chaste
See we linked in marriage band:
Venus Anadyomene,
And cunning Vulcan’s busy hand
she looked at Tom and Gerda and let her tongue play over her lips.
Regard for historical veracity also caused her to narrate events
connected with a certain person whose name she did not like to
mention!
On Thursday at four o’clock the usual guests came. Uncle Justus
brought his feeble wife, with whom he lived an unhappy existence.
The wretched mother continued to scrape together money out of the
housekeeping to send to the degenerate and disinherited Jacob in
America, while she and her husband subsisted on almost nothing but
porridge. The Buddenbrook ladies from Broad Street also came; and
their love of truth compelled them to say, as usual, that Erica
Grünlich was not growing well and that she looked more than ever
like her wretched father. Also that the Consul’s bride wore a rather
conspicuous coiffure. And Sesemi Weichbrodt came too, and
standing on her tip-toes, kissed Gerda with her little explosive kiss
on the forehead and said with emotion: “Be happy, my dear child.”
At table Herr Arnoldsen gave one of his witty and fanciful toasts in
honour of the two bridal pairs. While the rest drank their coffee he
played the violin, like a gipsy, passionately, with abandonment—and
with what dexterity!... Gerda fetched her Stradivarius and
accompanied him in his passages with her sweet cantilena. They
performed magnificent duets at the little organ in the landscape-
room, where once the Consul’s grandfather had played his simple
melodies on the flute.
“Sublime!” said Tony, lolling back in her easy-chair. “Oh, heavens,
how sublime that is!” And she rolled up her eyes to the ceiling to
express her emotions. “You know how it is in life,” she went on,
weightily. “Not everybody is given such a gift. Heaven has
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com