Web Development Lesson 8..
Web Development Lesson 8..
Introduction
Maria Database is one of the most popular relational database management system
(DBMS). It is an open source version of MySQL database. Maria Database is based on
Structured Query Language (SQL). SQL is a standard language for creating, storing,
and fetching data in databases. we are going to learn how to use Maria Database and
PHP in windows.
Now that we have our environment working, we can start working with Maria DB.
1|P ag e
create database school;
Database to be changed
Use the following table commands to assist you in filling the form below it.
2|P ag e
Comments:
How to create students table: select database name on left column >then select new
>table dash board will appear as illustrated on the above image
Fill the remaing details with the help of the table commands @ image step 3
when through click save button located near preview SQL
Incase you want to add fields >click the column(s)Go button to add other
fields.
To see the created table
3|P ag e
So far, we have created a database school and a table student inside it. Now, let’s
view this database school and its tables in PhpMyAdmin. Open your browser and
navigate to http://localhost/phpmyadmin/. You should see something like this.
Select school database Click students then structure Tab to Check table fields
exist.
Here, we will create a form and store the data collected from it in our school database.
The file index.php will carry the form HTML code, while connect.php connects the
form with the database.
4|P ag e
Save as index.php
Next document
Style.css
5|P ag e
Save as Style.css
6|P ag e
Now, let’s connect our form with the database.
Save as connect.php :
7|P ag e
8.3 Storing data in the database
8|P ag e
8.4 Fetching data from the Database (using CRUD operation) Create, Read,
Update &delete
To fetch the data that we just saved, add the code below
into index.php right under the </form> tag.
9|P ag e
On refreshing the page, we should see:
The data at the bottom of the page has been fetched from the database.
10 | P a g e