MySQL Cookbook, Second Edition - Examples
This page provides links to several web scripts that are either discussed in
MySQL Cookbook, Second Edition, or that are based on techniques shown in the book.
(You may find it helpful to examine the source code for the scripts when
you try them out.
The scripts are available from the
downloads page.)
-
Simple FULLTEXT searching.
This script uses the
mcb-kjv
distribution as a source of searchable text.
It demonstrates both keyword and phrase searching techniques.
[Run search]
-
Using database content to generate web output.
clicksort.pl
retrieves the contents of the
mail
table from the cookbook database and displays it as an HTML
table.
The column headings are active links that you can select to re-sort the
table by the corresponding column.
[Run script]
-
Using database content to generate navigational elements:
-
The Book of Esther, displayed in a single page with in-page navigational
links to each chapter.
[Run script]
-
The Book of Esther, displayed using a separate page for each chapter along
with navigational
links to each page.
[Run script]
-
A list of states in the United States as a paged display with generic
"previous page" and "next page" links.
[Run script]
-
A list of states in the United States as a paged display with links to
each of the individual pages of the display.
[Run script]
-
Access counting and logging.
These scripts serve both as hit counters (total number of page accesses) and
as hit loggers (when each access occurred).
Each script displays the current hit count and a list of the times at which
the last 10 accesses occurred.
[Perl version]
[Ruby version]
[PHP version]
[Python version]
[JSP version]
-
Web session support.
Each of these these scripts
uses a session record stored in MySQL to keep track of how many
times you invoked the script and the times at which you invoked it.
After the 10th time, the session information is discarded and starts over.
[Perl version]
[Ruby version]
[PHP version]
[JSP version]
If you find that one of these examples doesn't appear to work properly,
please let me know.
Inquiries may be sent to
mysql-cookbook@kitebird.com.
Last modified: November 27, 2006
[MySQL Cookbook main page]