title: How to get multiple rows from mysql & PHP with this function
body: <p>I have this function which returns only one row, How can I modify the function so that it returns more than one row?</p>
  
  <pre><code>public function getVisitors($UserID)
  {   
  $returnValue = array();
  $sql = "select * from udtVisitors WHERE UserID = '".$UserID. "'";
  
  $result = $this-&gt;conn-&gt;query($sql);
  if ($result != null &amp;&amp; (mysqli_num_rows($result) &gt;= 1)) {
  $row = $result-&gt;fetch_array(MYSQLI_ASSOC);
  if (!empty($row)) {
  $returnValue = $row;
  }
  }
  return $returnValue;
  }
  </code></pre>