PHP/MySQL : Creating a guest book
Olivier Roble
Creating the Database Table
In our example, we will use only one table to store the visitors' comments. Before designing any page, we must create this
table. We will call it
impression and it will be composed of six columns corresponding to the various pieces of information entered by the visitors.
Create the table with the following structure:
| Data
|
Column name
|
Data type
|
| Unique identification number
|
id
|
UNSIGNED SMALLINT, Auto-incremented
|
| Name or nickname
|
name
|
VARCHAR, maximum 128 characters
|
| E-mail
|
email
|
VARCHAR, maximum 128 characters
|
| Date
|
date
|
DATE
|
| Feedback
|
impression
|
ENUM('like','dislike')
|
| Comments
|
comments
|
TEXT
|