Show Record from Database in MYSQL using PHP

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>
<h1>View Student Record</h1>
$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>";


Post a Comment


POST Answer of Questions and ASK to Doubt

Post a Comment (0)