Creating MySQL Database using phpMyAdmin
Subject: Web development using PHP and MySQL
In any database-driven web application or systems it is always a good approach to start from the ground up; 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 or any degital alternative tool before proceeding with the creation of the computer, on a small scale project like this we may not have much problem because the database may probably have just one or few tables, but in a banking application or educational management systems, where we may have 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
First have the idea or design of the tables in your database. For example, what the design of the feedback tables in the BGdb would like. You can name the database e.g BGdb after the company or project name.
database name: BGdb
table(s): Feedback
fields in Feedback table: id, name, email, comment, date_submit
Note that the feedback table’s fields is design after the data that will be sent via 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 for example.
Then the
date_submit field is for the company to know when the record e.g feedback or comment was submitted or stored in the table.
Create database
Now we can create the database using PhpMyAdmin, the PhpMyAdmin is a web based MySQL administration too that comes with XAMPP or WAMP server is already.
Visit the URL http://localhost/phpmyadmin if XAMPP server is started it will load PhpMyAdmin’s login page from their you can access it's dashboard.
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.
Note: any task done with PhpMyAdmin actually issues an SQL query to the MySQL database, for example as you can see in the SQL query box above: CREATE DATABSE ‘BGdb’;
Notice that when you create a new database it will not have anything, therefore in the next topic will actually create the "FeedBack" table.
Database design
Create new database
Database created but no tables yet
By:
Benjamin Onuorah
Login to comment or ask question on this topic
Previous Topic Next Topic