Show Record from Database in MYSQL using PHP.
Step1st:- Create PHP page
Step2nd:- Write PHP Script to Show data using SQL Query "select * from tablename" ,it will return data in Object form then we will use mysql_fetch_array() which will convert Object data to array data.
I am Creating table Student which contain rno,sname,branch and fees
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>View Student Record</h1>
<hr>
<?php
$conn= mysqli_connect('localhost','root','','php12batch');
$res = mysqli_query($conn,"select * from student");
while($x = mysqli_fetch_array($res))
{
echo $x[0],' ' ,$x[1],' ',$x[2],' ',$x[3],"<hr>";
}
?>
</body>
</html>
Step1st:- Create PHP page
Step2nd:- Write PHP Script to Show data using SQL Query "select * from tablename" ,it will return data in Object form then we will use mysql_fetch_array() which will convert Object data to array data.
I am Creating table Student which contain rno,sname,branch and fees
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>View Student Record</h1>
<hr>
<?php
$conn= mysqli_connect('localhost','root','','php12batch');
$res = mysqli_query($conn,"select * from student");
while($x = mysqli_fetch_array($res))
{
echo $x[0],' ' ,$x[1],' ',$x[2],' ',$x[3],"<hr>";
}
?>
</body>
</html>
POST Answer of Questions and ASK to Doubt