title: How sql query can modify, such that repeating part is not displayed
body: <p>This is related to our group project done at school.Our framework is codeigniter. </p>
  
  <pre><code>SELECT *  
  FROM projects, task 
  WHERE projects.projectname = task.projectname
  </code></pre>
  
  <p>The above sql statement merge project table and task table where one project has many tasks. We display result of above sql statement by using a table. this table has 4 columns as project name, client, task , task related employee. As project is having many tasks project name and client repeat in every table record. What we want to do it only show this project name and client only once and show task under that. How can I do that?
  This is our view code</p>
  
  <pre><code>&lt;table class="table table-lg" id="Table"&gt;
                  &lt;thead &gt;
                      &lt;tr class="filters"&gt;
                          &lt;th &gt;&lt;input type="text" class="form-control" placeholder="Project" disabled&gt;&lt;/th&gt;
  
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Client " disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Project Start On" disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="End On" disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Task" disabled&gt;&lt;/th&gt;  
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Description" disabled&gt;&lt;/th&gt;  
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Commission" disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Task Start On" disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Due On" disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Start" disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Pause" disabled&gt;&lt;/th&gt;
                          &lt;th&gt;&lt;input type="text" class="form-control" placeholder="Stop" disabled&gt;&lt;/th&gt;
  
  
  
  
  
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                &lt;?php
                  if(isset($view_data) &amp;&amp; is_array($view_data) &amp;&amp; count($view_data)): $i=1;
                  foreach ($view_data as $key =&gt; $data) { 
                  ?&gt;
                  &lt;tr class="highlight" &lt;?php if($i%2==0){echo 'class="even"';}else{echo'class="odd"';}?&gt;&gt;
                      &lt;td&gt;&lt;?php echo $data['projectname']; ?&gt;&lt;/td&gt; 
  
                      &lt;td&gt;&lt;?php echo $data['ClientName']; ?&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;?php echo $data['datetimepicker20']; ?&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;?php echo $data['datetimepicker21']; ?&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;?php echo $data['task']; ?&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;?php echo $data['Description']; ?&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;?php echo $data['Commission']; ?&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;?php echo $data['datetimepicker21']; ?&gt;&lt;/td&gt;
  
                      &lt;td&gt;&lt;?php echo $data['datetimepicker22']; ?&gt;&lt;/td&gt;
  
  
  
  
  
  
  
  
              &lt;td&gt;&lt;input type="checkbox" name="cb1" id="cb1" value="y" onChange="changeSoma(this, 'red')" /&gt;&lt;/td&gt;
  
  
              &lt;td&gt;&lt;input type="checkbox" name="cb2" id="cb2" value="y" onChange="changeSoma(this, 'green')" /&gt;&lt;/td&gt;
  
              &lt;td&gt;&lt;input type="checkbox" name="cb3" id="cb3" value="y" onChange="changeSoma(this, 'yellow')" /&gt;&lt;/td&gt;
  
              &lt;/tr&gt;
  
  
                  &lt;?php
                      $i++;
                        }
                      else:
                  ?&gt;
                  &lt;tr&gt;
                      &lt;td colspan="7" align="center" &gt;No Records Found..&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;?php
                      endif;
                  ?&gt;
  
              &lt;/tbody&gt;                
              &lt;/table&gt;
  </code></pre>