Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

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>



Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post