title: code is returning data of one date only whereas i want data of every date
body: <pre><code>function practise()
  {
      $this-&gt;load-&gt;database();
       $qry = mysql_query("select * from demmo");
    if (mysql_num_rows($qry) &gt; 0) 
  {
       while ($row = mysql_fetch_array($qry))
    {
        $created = $row['created'];
  //from here
        $qry = mysql_query("select * from demmo where created = '$created'");
  
              while ($res = mysql_fetch_array($qry))
              {
                  $user_id = $res['id'];
                  $name = $res['name'];
                  $created2 = $res['created'];
              $users[] = array('user_id' =&gt; $user_id, 'name' =&gt; $name);             
              }
                  $dotts[] = array('created' =&gt; $created2);
  //till here       
  }                       
      return array ($dotts,$users);
  }
  }
  </code></pre>
  
  <p>in demmo table i am trying to fetch data and showing that data according to date .the problem is that the code is only selecting one date from the table from created rows and showing that data only .fortunately data shown is not only last but the data with actual date.</p>