April 2026
Intermediate
1009 pages
34h 15m
English
To conclude this chapter—and the entire database section—we implement the well-known guestbook example based on MongoDB. The basic structure of the application remains the same, but the communication of the database is carried out according to the information on the previous pages. Only a few details have been changed.
We assume the default values for the application: the running MongoDB instance is on the current server, uses the default port, and needs no additional authentication. We create a new guestbook collection once in the PHP database (which may already exist from the previous examples). As discussed, we do not need a database schema.
<?php require_once __DIR__ . "/vendor/autoload.php" ...
Read now
Unlock full access