INTRODUCTION TO DATABASE USING PHPMYADMIN

Hi guys, In my previous post, We explored the XAMPP server and seen how to run the web application in the local machine.

Today we are going to dig into Databases, Yes! Every application is required with backend support i.e., database. For example whenever we try to book our tickets on IRCTC website it looking for user credentials, Once we gave our details it will do backend validation. Anyone wonders how this is works?
   Simple Client-Server Architecture 

How Database works?

  • A client need initiates the request through a web browser on a client machine requests a page from the Web site. The request travels across the Internet based on the requested URL.
  • Based on request the application server runs the requested application, which probably needs data from the database server. i.e., Login Server
  • The application server needs to make a request to the database server, including security information.
  • Once the request passes security and is processed, the database server returns the requested information to the application.
  • The application creates a web page and sends it to the Web server which sends it back to the requesting Web browser.

Let's see in action

Inside the XAMPP, we have an option called MYSQL. By click start button, your database turned into green color stating that database is in an active state.
XAMPP control panel


Once its get started, click the Admin button to view the phpmyadmin interface 
phpMyAdmin Interface


Click the Database tab, Create Database with the name "SampleDB".

Creation of  database in phpMyAdmin

Once Database Created, Its time to create to a table structure. Creating the table with name "sampletable" under the SampleDB along with the number of columns.

Creation of Table 

After the creation of a table, we need to create the columns names. In this article, we are creating a database for validating the user credentials so I created two column username, password respectively.

sampletable structure creation

SampleTable Structure with two columns

For the demo purposes created a sample record which will validate through the web application.

Dummy record created under the "sampletable"  Table

Now, Its time to create a simple login web interface using HTML.
Copy the code and run it in the web browser.
Login Screen 

Next, Create a server-side action (code ) to access the database. There are plenty of server-side languages used by developers. We will see those languages in detail in the upcoming post, now am using PHP.(any way will give you short description below 👇.)

Short Intro to PHP

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.PHP is a server scripting language and a powerful tool for making dynamic and interactive Web pages.

create a PHP file named "action_page.php" under the Page folder.

The above PHP code  taking value from HTML and validating with database value which we created and by hitting submit button php start doing its action and showing the output for us
action_page.php  Output Screen 
Awesome you made it again. Successfully integrated the phpmyadmin database with your simple login web page.

If you have any doubts in this article, please leave your comments .see you in next post

Comments

  1. This is Sachin. I was going thru your both blogs and would like to discuss something which you might be interested in. Kindly prompt me on my email address in case you see my message and would like to contact me.
    E-Mail= srivastavasachin120@gmail.com

    ReplyDelete

Post a Comment

Popular Posts