title: PHP find out student record using functions
body: <ul>
  <li><p>Table: <strong>student</strong><br />
  <a href="https://i.stack.imgur.com/ZCeWN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZCeWN.png" alt="enter image description here"></a></p></li>
  <li><p>student.php</p>
  
  <pre><code>&lt;?php
  function findStudentRecord()
  {
        //Db connection
  
        $q1 = "select * from student where gender = 'F'";
        $r1 = mysqli_query($dbc, $q1);
        $total_records = mysqli_num_rows($r1);
  
        $record = array();
        if($total_records &gt; 0)
        {
            while($row1 = mysqli_fetch_array($r1, MYSQLI_ASSOC))
            {
                $record[] = $row1;
            }
        }
        else
        {
            //[HERE]
        }
  
        return $record;
  }
  
  $record = findStudentRecord();
  //[HERE]
  ?&gt;
  </code></pre></li>
  <li><p>I want to find female student record but there is no record from my database. How do I return 0 value from function and display "No record found" on my web page in [HERE] section? </p></li>
  </ul>