2016-06-02 9 views
-2

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**Fatal error: Call to undefined function mysqli_fetch_rows() in /home/u545753064/public_html/index.php on line 14

<?php 
     include('/home/u545753064/public_html/classes/image_class.php'); 

     $obj_image = new Image(); 

     if(@$_POST['Submit']) 
     { 
      $obj_image->image_name=str_replace("'", "''", $_POST['txt_image_name']); 
      $obj_image->image=str_replace("'", "''", $_POST['txt_image']); 

      $obj_image->insert_into_image(); 

      $data_image=$obj_image->get_all_image_list(); 
      $row=mysqli_fetch_rows($data_image); 
     } 

    ?> 

    <!DOCTYPE html> 
    <html> 
    <head> 
     <title>PHP IMAGE UPLOAD</title> 
    </head> 
    <body> 
     <center><h1>PHP SCHOOL</h1></center> 
     <center><h1>PHP IMAGE UPLOAD IN DATABASE</h1></center> 

     <center> 
      <form method="post" enctype="multipart/form-data"> 
       <table border="1" width="80%"> 
        <tr> 
         <th width="50%">IMAGE NAME</th> 
         <td width="50%"> 
         <input type="text" name="txt_image_name"> 
         </td> 
        </tr> 
        <tr> 
         <th width="50%">UPLOAD IMAGE</th> 
         <td> 
         <input type="file" name="txt_image"> 
         </td> 
        </tr> 
        <tr> 
         <td></td> 
         <td> 
          <input type="submit" name="Submit" value="SAVE"> 
         </td> 
        </tr> 
       </table> 
      </form> 
     </center> 

     <?php 
      if($row != 0) 
      { 
     ?> 

     <center> 
     <table width="80" border="1" > 

       <?php 
       $icount = 1; 

       while ($data = mysqli_fetch_assoc($data_image)) 
       { 
       ?> 
       <tr> 

        <td style="text-allign:center" style="width:10%"><?php echo $icount; ?> 
        </td> 
        <td style="text-allign:center" style="width:10%"><?php echo $data['image_name']; ?> 
        </td> 
        <td style="text-allign:center" style="width:10%"><img src="images/<?php echo $data['image']; ?>" style="height:100px;" > 
        </td> 
       </tr> 
       <?php 
       $icount++; 
       } 

       ?> 
     </table> 
     </center> 
     <?php 
     } 
     ?> 
    </body> 
    </html> 
+0

, wenn Sie versuchen, ohne eine Verbindung zuerst zu holen und eine Auswahl, es wird nicht funktionieren Einrichtung ... – Louis

+0

i verbunden mit meiner anderen Seite hier

Antwort

0

Das ist, weil es keine Funktion ist mysqli_fetch_rows() - aber es gibt eine mysqli_fetch_row(), die liefert einen Reihe.

Verwandte Themen