connect_error) { die("connection failed".$conn->connect_error); } $sql="select Student_name,Email,Contact_no from registerstudent where Student_name='Arp'"; $result=$conn->query($sql); if($result->num_rows>0) { $i=1; while($row=$result->fetch_assoc()) { echo "".$i++."".$row["Student_Name"]."".$row["Email"]."".$row["Contact_no"].""; } echo ""; } else echo "0 result"; $conn->close();*/ session_start(); // print_r($_SESSION); // echo $_SESSION["us"] . "
" ; $servername = "localhost"; $username = "root"; $password = ""; $dbname = "sch"; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT Student_name,Email,Contact_no FROM registerstudent where Student_name= '" . $_SESSION['us'] . "'"; $result = $conn->query($sql); // print_r($result); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "
"; echo "
"; echo "
"; echo "
"; echo "

Name : " . $row["Student_name"]. "

Email :" . $row["Email"]. "

Work-Experience :

Extra-Curriculars :" . $row["Contact_no"]. "

"; // echo "Student_name: " . $row["Student_name"]. " - Email: " . $row["Email"]. " " . $row["Contact_no"]. "
"; } } else { echo "0 results"; } $conn->close(); ?>