title: mysqli_result value to variable in php
body: <p>Echo of <code>facultyname</code> is showing a value but <code>fid</code> is not getting value.
  I want to assign value of <code>fid</code> to a variable.</p>
  
  <pre><code>$facultyname=$_POST['facultyname'];
  echo $facultyname;
  
  $query="SELECT fid FROM faculty WHERE fname='$facultyname'";
  $fid_result=mysqli_query ($link,$query);
  $finfo = mysqli_fetch_field($fid_result);
   printf("FacultyID :- %d     ",$finfo-&gt;fid);
  </code></pre>