In any database-driven web application or systems it is always a good approach to start from the ground to top, of from the backend to the frontend; therefore we will start from our backend which is to design and create the database, please note that I said design before create. This is because the design of a database is a serious business that involve creating a blue-print of what the database would look like on a piece of paper before moving to the computer, on a small scale project like this we may not have much problem because the database may probably have just one table, but in a banking application or educational management systems, where we may have close to if not more ten tables in its database, most which will be related, this would be more complex and therefore require more patience to design.
Creating the Database
Below is what the design of my feedback database would like, please note I prefer to name the database after the owner company’s name, which I shortened to BGdb.
As you can see the Feedback table’s fields is design after the data expected from the Feedback form, except for the id and date_submit which plays important role; the id field usually contain auto-generated ascending numbers, this field is actually the primary key of this table, a primary keys uniquely identifies an individual record, for example your bank account number or your student matriculation number is a typical example of a primary key; this ID’s are unique that no students have the same in a particular school, that is why when your lecturer or school authority wants to discipline a student they go after his or her matric number and not there name because we may have students bearing the same first and surname but not matric number. With this number they can easily access a student record successfully. And the date_submit field is for the company to know when the feedback or comment was submitted or sent.
Now we can create the database using PhpMyAdmin, I assume that WAMP server is already started. See the Starting and Testing the Server page.
There are two ways you can start PhpMyAdmin; first, through the alias of the server from the taskbar. See the screenshot below.
Or simply type the URL http://localhost/phpmyadmin directly to the address bar.
Below is the screenshot of PhpMyAdmin’s homepage.
The home of your PhpMyAdmin would look exactly like what I above except that the list of the databases (4r, airline, bookshop…..wordpress) at the left won’t be available or be exactly the same with what I have above.
Now enter “BGdb” in the field below the text “Create new database” and click the “Create” button to create our new database, see the screenshot below.
After clicking the Create button, the database will now be created and will automatically be the active or selected database as you can see below.
Note: any task done with PhpMyAdmin actually issues an SQL query to the MySQL database, as you can see in the SQL query box above: CREATE DATABSE ‘BGdb’;