Thomas Valentine
Database-Driven Web Development
Learn to Operate at a Professional Level with PERL and MySQL
1st ed.
Logo of the publisher
Thomas Valentine
Selkirk, MB, Canada
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the books product page, located at www.apress.com/9781484259696. For more detailed information, please visit http://www.apress.com/source-code.
ISBN 978-1-4842-5969-6 e-ISBN 978-1-4842-5970-2
https://doi.org/10.1007/978-1-4842-5970-2
Thomas Valentine 2021
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This Apress imprint is published by the registered company APress Media, LLC part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.
For Allison, our family miracle
Introduction
It has been three years since I wrote a technical book. I enjoyed writing this book as much as I did the first for Apress, some years ago. One of the hardest parts of writing this book was to separate the weed from the chaff. That is, what should I include that will make you, the reader, experience an aha! moment after reading a particularly eye-opening chapter or section?
I separated the useless information that always seemed to be repeated in one way or another within all of the books Ive read on the subject. I realized that some knowledge was missing from the books Ive read on database-driven web development. I broke down the constituent parts of the common cgi script and thought back to when I was learning Perl and MySQL. I remembered the questions I asked myself and what would have been useful to know. These techniques took me years to perfect. Im looking forward to hearing your feedback on what you learn from my techniques.
I develop in Perl and MySQL, so that is what this book will be teaching you. Perl is a wonderful language to work with. It can be learned in a weekend but takes many years to master. MySQL is a great partner to the abilities of the Perl scripting language. It too can be learned in a weekend.
In the chapters to come, youll be introduced to some concepts that you know and understand. My hope is to take that morsel of knowledge further and expand on it until the wider picture is placed in your mind. I go the extra step and present it in an intuitively obvious form with plain language explanations and simple to understand examples, each example building on the knowledge imparted from the last.
Well explore concepts that Ive not been able to find in any other book on the subject. They all seem to generate the same knowledge, but with only minor concepts you might already know. They all look alike and, in my opinion, dont go very far past the minimum to get the job done.
Ive broken up the chapters of this book into logically consecutive blocks of knowledge. In the examples to come, youll be taught not only how Perl and MySQL work, but how the four main languages and specifications all work together to generate a fully formed HTML document. Understanding those four specifications (HTML, CSS, DOM, and JavaScript) is crucial to your success as a web developer. They must be taught in a way that shows their flexibility and well-thought-out implementation.
Using Perl and MySQL with those four specifications is stimulating and rewarding. Theres always a moment of personal satisfaction when a particularly tricky script works perfectly for the first time.
I hope I put forward the concepts and techniques in an easy-to-understand but still information-packed book. Read on, and remember the only limit is your imagination.
Table of Contents
About the Author
Thomas Valentine
With 20 years of experience as both a professional web developer and writer, Thomas Valentine is uniquely qualified to have written this book. He is a LAMP, Perl, PHP, and MySQL web developer, programmer, and expert. He writes for various magazines and websites and has been a technical consultant for large-scale, database-driven websites such as FedEx.ca and Texas Instruments (ti.com).
About the Technical Reviewer
Kenneth Fukizi
is a software engineer, architect, and consultant with experience in coding on different platforms internationally. Prior to dedicated software development, he worked as a lecturer for a year and was then head of IT at different organizations. He has domain experience working with technology for companies in a wide variety of sectors. When hes not working, he likes reading up on emerging technologies and strives to be an active member of the software community.
Thomas Valentine 2021
T. Valentine Database-Driven Web Development https://doi.org/10.1007/978-1-4842-5970-2_1
1. Database-Driven Web Development Fundamentals
The database was first created by software engineers at North American Rockwell in the mid-1970s. They were previously using static files to catalog the work they were producing. They began to notice that efforts were being duplicated, as a project such as the designing of an Apollo-era rocket generates hundreds of thousands of different parts. Each part was given a static file. Keeping track of these hundreds of thousands of parts was a nightmare before the relational database was put into practice. With it, they were able to find the duplicated efforts and eliminate them.
Well begin this chapter by reviewing the fundamentals of database-driven websites before moving on to the pros and cons of web hosting, delving into the options that are available. Youll see how the modern database fits into the process of using three different servers (the Perl, Apache, and MySQL servers) to generate a web page. These three servers are what well be learning to use together in this book. Read on, its going to be fun!
The Evolution of the Database-Driven Approach