How to select entire column data of 2 rows using php?

Let me explain what actually I want to do.I am storing user’s information in mysql table named “students_data”. Here, now I just want to print those names in the table below except the user who logged in.Suppose I haven total 5 users list including me on table with their First name , last name and others detail.
Below the h2 tag in table I want to print those names that are on table only the First name and last name, obviously excluding me.

<?php
$serverName="localhost";  
$userName="samsung";  
$password="8198982039";  
$dataBase="students_record";  
$conn=mysqli_connect($serverName,$userName,$password,$dataBase);  
$sql= "SELECT First_Name FROM students_data";  
$result=mysqli_query($conn,$sql);  
$cols=mysqli_fetch_array($result,MYSQLI_BOTH);  
?>  

<html>  
<head>  
    <title></title>  
    <link rel="stylesheet" type="text/css" href="bootstrap.min.css">  
    <meta name="viewport" content="width=device-width,initial-scale=1" >  
    <style>  
    </style>  
</head>  
<body>
<div class="container">  
<div class="col-sm-4"></div>  
<div class="col-sm-4" >  
    <h2>Friends You may know</h2>  
    <table class="table table-striped">  
        <tr>  
            <td><?php?></td>  
        </tr>  
    </table>  
</div>  
<div class="col-sm-4" >  
    <h2>Your status</h2>  
</div>  
</div>  
</body>  
</html>  


Source: mysql

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.