How to Fetch Data From Database in PHP And Display HTML Tables

Sharing buttons:

hello eyes welcome to the online

attitudes toward call my name is asif

ali in this video i'm going to show you

how to fetch my SQL database and display

an HTML tables using PHP right so this

is a my database and this is my table

this is my database lambda student and

this is a table Saad rate of his name is

demo and mm is student and here you can

see it these four cards available in

this table student tables so I'm gonna

display these record on the HTML tables

using PHP so let's get started this is a

my code editor so and here the folder

available in this code editor so I

right-click it and make a new file first

I create a connection file

first I write MySQL Connect and pass

three parameters localhost root and

password is null the second step you

need to write my SQL DB connect my SQL


MySQL mmm sorry my SQL select DB and my

database name is demo right and save the

file and create another file

I write index dot PHP and first we need

to import this connection file on here

so you need white ones include

I ride the PHP basic syntax and encode

funds and pass the file connection dot

PHP then you need to write variable to

assign the kirie select aesthetic from

my table name is student and then you

need to write another variable to assign

this curie

on this variable so you need fried MySQL

theory and pass this variable on her

right then the next system you need to

write the basic syntax of HTML title hat

fetch data wrong data less ok body body

kilos then you need to write the table

tag and then TR tag TR tag and th tag

table heading tag and I used the heading

first heading is h2 student record right

this is a table steak and this is a TR

means table row TR th means table

heading right then I again used th and

then my first column name is ID second

column name is name third column name is

email and fourth column name is country

right this is a basic HTML syntax so I

open my file search data and here you

can see it the only display the student

record and then ID but I change the TR

to display these record another TR means

table row and paste here save and open a

refresh here you can see it the ID name

email country display on here then I use

attribute tools design the table and

bought a one pixel and I use this tile

to display the table on the browser

read 300 pixel and line-height 30 pixel

okay so open the fish here you can see

it the first column is display in single

box and here you can see it three

columns display in one by one but ID

column is a large column so that's not

good so let's set up the first column is

called Spain and assign the column for

refresh here you can see it that's great

align Y line

okay okay that's good looking so nice

right so I checked the with 300 pixel

line height I increase the width okay

that's so nice and increase the height

okay the next time you need to go on the

after TR closing tag you need to write

the PHP basic syntax and then you need

to write while loop and make a variable

roles and assign the MySQL fetch a

source and pass the result variable hat

then you need to right-click the case

and then you need to write TR again

double tag but I close the PHP

here then I used er double means double

row and then TD and I use go PHP PHP

clause and echo then my variable name

copy and paste here and then rod sign

and first column name your database my

life first column database name is ID so

I pass simple ID here then I copy this

score and test again again and again I

now enter name email basically these are

my database column names

so I write database column names cell

and then I after the closing TR tag I

write again PHP code PHP basic syntax

and after these clip record so I close

the PHP table that's it first save the

file and open the browser refresh the

patch where is the mistake 29 29 29 29

here 29 so this there is a mistake 29

here okay this is a basically I use

terminal sign terminal sign terminates

sign and tammini science safe

okay but why another problem 32 line

okay here you can see it the record

display on my Devils health you can see

it for number of four cars available in

my database and here you can see it 1 2

3 4 and same record display on the table

they are a very simple process to

display the record and in Devils using

PHP and MySQL database so that's very

simple process I hope you are understood

I well thank you very much for watching

please subscribe my channel for getting