As a continuation to the last exercise, that is after creating the Database
Enter “Feedback” in the field below Create new table on the database BGdb” and enter “5” for the Number of fields and click the “Go” button.
See the screenshot below
Immediately this is done, you will see several form elements arranged as we have below, this is to enable you to setup the five (5) fields and their respective properties.
Now let’s start with the first and probably the most important field, ID.
I fill the id space as we have below
Similarly I fill the other fields as we have in the screenshot below. These fields are name, email, comment and date_submit, while the properties I set for each of these are only Field, Type, Length/Values and Null
When this is done, then click the “Save” button and the Feedback table will be created as we have below.
If you prefer to do this using an SQL statement, click the SQL tab,
And enter this SQL below, in the box before clicking the “Go” button.
CREATE TABLE Feedback (
id INT(10) NOT NULL AUTO_INCREMENT ,
name VARCHAR(255) NULL ,
email VARCHAR(255) NULL ,
comment TEXT NULL ,
date_submit DATETIME NULL ,
PRIMARY KEY (id)
);
To show this SQL example (below) I replace Feedback with Feedback2 so the name won’t conflict with the existing Feedback table.
Clicking the “Go” button the table would was created.
I knew using this SQL method could be little bit awkward to some new web developer, so let’s use this opportunity to learn how to delete this table. The technical term for this is “drop” so let’s drop the feedback2 table.