title: calling multiple functions within a class
body: <p>I was trying to pullout the content of all the functions defined from the class segment in segment.php. And calling all the three functions from a class segment in home_segment.php
  Is this a correct way of calling multiple functions from one class. </p>
  
  <p>segment.php</p>
  
  <pre><code>&lt;?php
  $mysqli = mysqli_connect("localhost","root","","square");
   $cid = required_param('id', PARAM_INT);
   class segment
   {   
     public function unitseg_set1($cid)
     {          
       $subject = $mysqli-&gt;query('SELECT * FROM order_subject WHERE id='.$cid.'');     
       while($row=$subject-&gt;fetch_array() )
       {
          echo '&lt;div&gt;'.$row['chem_name'].'&lt;/div&gt;';
       }   
     }
  
     public function unitseg_set2($cid)
     {          
       $subject = $mysqli-&gt;query('SELECT * FROM order_subject WHERE id='.$cid.'');     
       while($row=$subject-&gt;fetch_array() )
       {
          echo '&lt;div&gt;'.$row['physiotherapy_nn'].'&lt;/div&gt;';
       }   
     }   
  
     public function unitseg_set3($cid)
     {          
       $subject = $mysqli-&gt;query('SELECT * FROM order_subject WHERE id='.$cid.'');     
       while($row=$subject-&gt;fetch_array() )
       {
          echo '&lt;div&gt;'.$row['commun_gg'].'&lt;/div&gt;';
       }   
     }   
   }
   ?&gt;
  </code></pre>
  
  <p>home_segment.php </p>
  
  <pre><code>&lt;?php
  
  
      require_once('segment.php');
     $account1 = segment::unitseg_set1($cid);
     $account2 = segment::unitseg_set2($cid);
     $account3 = segment::unitseg_set3($cid);
  
     echo $account1.$account2.$account3;
   ?&gt;
  </code></pre>