title: Fatal error: Call to undefined function mysqli_fetch_rows() in /home/u545753064/public_html/index.php on line 14
body: <blockquote>
    <p>I need this code for my project in school,  please help me with this
    code, i cant quite understand mysqli especially its functions, our
    professors taught us about mysql, not mysqli so i am in need of help
    in mysqli if possible you can rewrite it thanks much**</p>
  </blockquote>
  
  <pre><code>&lt;?php
          include('/home/u545753064/public_html/classes/image_class.php');
  
          $obj_image = new Image();
  
          if(@$_POST['Submit'])
          {
              $obj_image-&gt;image_name=str_replace("'", "''", $_POST['txt_image_name']);
              $obj_image-&gt;image=str_replace("'", "''", $_POST['txt_image']);
  
              $obj_image-&gt;insert_into_image();
  
              $data_image=$obj_image-&gt;get_all_image_list();
              $row=mysqli_fetch_rows($data_image); 
          }
  
      ?&gt;
  
      &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;PHP IMAGE UPLOAD&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;center&gt;&lt;h1&gt;PHP SCHOOL&lt;/h1&gt;&lt;/center&gt;
          &lt;center&gt;&lt;h1&gt;PHP IMAGE UPLOAD IN DATABASE&lt;/h1&gt;&lt;/center&gt;
  
          &lt;center&gt;
              &lt;form method="post" enctype="multipart/form-data"&gt;
                  &lt;table border="1" width="80%"&gt;
                      &lt;tr&gt;
                          &lt;th width="50%"&gt;IMAGE NAME&lt;/th&gt;
                          &lt;td width="50%"&gt;
                          &lt;input type="text" name="txt_image_name"&gt;   
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;th width="50%"&gt;UPLOAD IMAGE&lt;/th&gt;
                          &lt;td&gt;
                          &lt;input type="file" name="txt_image"&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;/td&gt;
                          &lt;td&gt;
                              &lt;input type="submit" name="Submit" value="SAVE"&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
              &lt;/form&gt;
          &lt;/center&gt;
  
          &lt;?php
              if($row != 0)
              {
          ?&gt;
  
          &lt;center&gt;
          &lt;table width="80" border="1" &gt;
  
                  &lt;?php
                  $icount = 1;
  
                  while ($data = mysqli_fetch_assoc($data_image)) 
                  {
                  ?&gt;
                  &lt;tr&gt;
  
                      &lt;td style="text-allign:center" style="width:10%"&gt;&lt;?php echo $icount; ?&gt;
                      &lt;/td&gt;
                      &lt;td style="text-allign:center" style="width:10%"&gt;&lt;?php echo $data['image_name']; ?&gt;
                      &lt;/td&gt;
                      &lt;td style="text-allign:center" style="width:10%"&gt;&lt;img src="images/&lt;?php echo $data['image']; ?&gt;" style="height:100px;" &gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;?php
                  $icount++;
                  }
  
                  ?&gt;
          &lt;/table&gt;
          &lt;/center&gt;   
          &lt;?php
          }
          ?&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>