I cant retrive value from SQL in PHP

php
mysql

#1

I am unable to retrieve values fro SQL
My code is,

<?php session_start(); $conn = mysqli_connect("127.0.0.1", "mehul87", '', "omnicat"); if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } echo "Connected successfully"; $sql= "select * from iron_study where Element='Serum_iron'"; $array=mysqli_query($conn,$sql) ; $data=mysqli_fetch_assoc($array); $optimal=$data['Optimal']; $Min=$data['Min']; $Max=$data['Max']; echo $Min; echo $Max; $sql1="select * from iron_study where Element='Transferrin_IBC'"; $array1=mysqli_query($conn,$sql1); $data1=mysqli_fetch_assoc($array1); $optimal1=$data1['Optimal']; $Min1=$data1['Min']; $Max1=$data1['Max']; echo $Min1; echo $Max1; ?>

I am getting following error:
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in /home/ubuntu/workspace/index.php