If you’d rather read this tutorial offline, you can download the chapters in PDF format.
As I explained in that chapter, PHP is a server-side scripting language that lets you insert into your web pages instructions that your web server software (in most cases, Apache) will execute before it sends those pages to browsers that request them.
So, to review, the table above is a three-column table with two rows, or entries.
Each row in the table contains three fields, one for each column in the table: the joke’s ID, its text, and the date of the joke.
The function of the id column, therefore, is to assign a unique number to each joke so that we have an easy way to refer to them and to keep track of which joke is which.
We’ll take a closer look at database design issues like this in Chapter 5, Relational Database Design.
In this example, the jokes would be stored entirely in the database.The advantages of this approach would be twofold: First, instead of having to write an HTML page for each of your jokes, you could write a single PHP script that was designed to fetch any joke from the database and display it by generating an HTML page for it on the fly.Second, adding a joke to your web site would be a simple matter of inserting the joke into the database.In Chapter 1: Installation, we installed and set up two software programs: the Apache web server with PHP, and the My SQL database server.In this chapter, we’ll learn how to work with My SQL databases using Structured Query Language (SQL).In a brief example, I showed how it was possible to insert the current date into a web page every time it was requested.Now, that’s all well and good, but things really become interesting when a database is added to the mix.In this chapter, we’ll learn what a database is, and how to work with your own My SQL databases using Structured Query Language.A database server (in our case, My SQL) is a program that can store large amounts of information in an organized format that’s easily accessible through programming languages like PHP.First, make sure that server is running, then type this command and hit Enter: tells it you’re going to provide a password.What you should see next is an Enter password: prompt.