title: Get data from a function array using OOP PHP
body: <p>Here is the code in my class file. I have separate class file and a product edit parts with  fields. When I access them in new page I get nothing.  </p>
  
  <pre><code>function editProd($editid){
      include('config.php');
  
      $query= sprintf("select * From product_data where id=".$editid."");
      $result=mysqli_query($con,$query);
  
  $data=array();
  
       while($row=mysqli_fetch_array($result) ){ 
  
           $data[]=$row;
  
  
          }
  
  
        return $data;
       }
  </code></pre>
  
  <p>This is how I access it in new page</p>
  
  <pre><code>include('prductclass.php');
  $addnewprod=new  Productdata();
  $addnewprod-&gt;editProd($_REQUEST['edit_id']);
  </code></pre>
  
  <p>but I get nothing in result so how do I fill my form in edit from</p>