title: How can I display data in one table from different sql statement?
body: <p>I Just only done first sql statement. Please see the link for demo what i've done till now. <a href="http://prntscr.com/57knmk" rel="nofollow">demo</a></p>
  
  <p>I want to show the other three sql statement's result in the other there columns. Check what i've wanted to do and finally want to do sum of the all time slot value. <a href="http://prntscr.com/57kp87" rel="nofollow">demo</a></p>
  
  <p>As far i've tried below code:</p>
  
  <pre><code>            &lt;?php
               $first_time_slot = "00:00:00 - 06:00:00";
               $second_time_slot = "06:01:00 - 12:00:00";
               $third_time_slot = "12:01:00 - 18:00:00";
               $fourth_time_slot = "18:01:00 - 23:59:59";
  
              $sql1 = mysql_query("SELECT date(`calldate`) as date, count(`src`)as total_caller, sum(`duration`) as total_duration FROM `cdr` WHERE time(`calldate`) BETWEEN '00:00:00' AND '06:00:00' AND `accountcode` = '09614008155' group by date order by date DESC");
  
              $sql2 = mysql_query("SELECT date(`calldate`) as date, count(`src`)as total_caller, sum(`duration`) as total_duration FROM `cdr` WHERE time(`calldate`) BETWEEN '06:01:00' AND '12:00:00' AND `accountcode` = '09614008155' group by date order by date DESC");
  
              $sql3 = mysql_query("SELECT date(`calldate`) as date, count(`src`)as total_caller, sum(`duration`) as total_duration FROM `cdr` WHERE time(`calldate`) BETWEEN '12:01:00' AND '18:00:00' AND `accountcode` = '09614008155' group by date order by date DESC");
  
              $sql4 = mysql_query("SELECT date(`calldate`) as date, count(`src`)as total_caller, sum(`duration`) as total_duration FROM `cdr` WHERE time(`calldate`) BETWEEN '18:01:00' AND '23:59:59' AND `accountcode` = '09614008155' group by date order by date DESC");
              ?&gt;
  
  
          &lt;table border="1" width="90%" class="fancy"&gt;
              &lt;caption style="color:#FF0000; margin-bottom:10px; font-size:16px;"&gt;Showing Caller History.&lt;/caption&gt;
              &lt;tr&gt;
                  &lt;th&gt;Date&lt;/th&gt;
                  &lt;th&gt;12am - 6am&lt;/th&gt;
                  &lt;th&gt;6am - 12pm&lt;/th&gt;
                  &lt;th&gt;12pm - 6pm&lt;/th&gt;
                  &lt;th&gt;6pm - 12am&lt;/th&gt;
                  &lt;th&gt;Total Caller&lt;/th&gt;
              &lt;/tr&gt;
  
              &lt;?php if (isset($first_time_slot)){
                  while ($row1 = mysql_fetch_assoc($sql1)) { ?&gt;
              &lt;tr&gt;
                          &lt;td&gt;&lt;?php echo $row1['date']; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $row1['total_caller']; ?&gt;&lt;/td&gt;
  
              &lt;?php }} ?&gt;
              &lt;/tr&gt;
  
  
          &lt;/table&gt;
  </code></pre>
  
  <p>Till now i just apply only 1st sql statement. How can i apply ohter three sql statements for other three columns. Please help me. Thanks in advanced. </p>