how to run select query in mysqli
<p>I need to show specific record, record exist in db but it showing nothing. Here my code is.</p>

<pre><code> $con=mysqli_connect("localhost","root","","test") or die("Connecting to MySQL failed"); 


$name=$_POST['uname'];

$query = "SELECT * FROM officedb WHERE name='.$name.'";
$data=mysqli_query($con,$query);   

while($row=mysqli_fetch_array($data)){
    echo $row['name'];
    echo $row['lname'];
    echo $row['department'];
}
</code></pre>