title: Same Function Passing different parameter in same query getting the both output at same time
body: <p>I am sending two parameter <code>From=2015-08-01</code> and <code>To=2015-08-31</code> is working fine. Then how to also passing parameter <code>(From2=2015-04-01 and  To2 =2015-08-31)</code> and getting the both output at same time. Please do not write any other functions. Please advise me.</p>
  
  <p><strong>This is my output.php</strong></p>
  
  <pre><code>  $res1=$con-&gt;selectnonschoolround1($From,$To);
    while($row=pg_fetch_array($res1))
    {
      $r1=$row['non_slsc_qty'];
      $r2=$row['non_slst_qty'];
      $r3=$row['non_slot_qty'];
      $r4=$row['non_slsc_ben'];
      $r5=$row['non_slst_ben'];
      $r6=$row['non_slot_ben']; 
      $Total_qty_non_r1=$row['total_qty']; 
      $Total_ben_non_r1=$row['total_ben']; 
    }
  </code></pre>
  
  <p><strong>This is the class.php</strong></p>
  
  <pre><code>class DB_con
  {
  
    function __construct()
    {
      $db = pg_connect("host=localhost port=5432 
      dbname=mydb  user=postgres password=123");
    }
    public function selectnonschoolround1($From,$To)
    {
        $res1=pg_query("SELECT
        SUM(non_slsc_qty) as non_slsc_qty,
        SUM(non_slst_qty) as non_slst_qty,
        SUM(non_slot_qty) as non_slot_qty,
        SUM(non_slsc_ben) as non_slsc_ben,
        SUM(non_slst_ben) as non_slst_ben,
        SUM(non_slot_ben) as non_slot_ben,
        SUM(non_slsc_qty+non_slst_qty+non_slot_qty) AS total_qty,
        SUM(non_slsc_ben+non_slst_ben+non_slot_ben) AS total_ben
        FROM table  where date BETWEEN '$From' AND '$To'");
        return $res1;
    }
  }
  </code></pre>