title: How to collect the array data?
body: <p>I have a mysql code that needs to be improved because of my limited knowledge. I am new in php-mysql.I have data arrays at my DB and I want to show data such as:</p>
  
  <pre><code>Date             Model        Qty         Name
  2010-08-23       boo          2          Steve
  2010-08-24       boo          1          Steve
  2010-08-25       boo          2          David
  2010-08-25       blob         1          Steve
  </code></pre>
  
  <p>I have tried using this code, but the results is not like what I wanted.</p>
  
  <pre><code>"SELECT id, DATE(A.Inspection_datetime) AS Date,
                    A.Model, COUNT(A.Serial_number) AS Qty,
                    B.name
                    FROM inspection_report AS A
                    LEFT JOIN Employee AS B
                    ON A.NIK=B.NIK
                    GROUP BY A.Model, B.name, A.Inspection_datetime"
  results:
  Date             Model        Qty         Name
  2010-08-23       boo          1          Steve
  2010-08-23       boo          1          Steve
  2010-08-24       boo          1          Steve
  2010-08-25       boo          1          David
  2010-08-25       boo          1          David
  2010-08-25       blob         1          Steve
  </code></pre>
  
  <p>How do I do to resolve this problem?</p>
  
  <pre><code>     CREATE TABLE IF NOT EXISTS `inspection_report` (
            `id` int(11) NOT NULL AUTO_INCREMENT,
            `Model` varchar(14) NOT NULL,
            `Serial_number` varchar(8) NOT NULL,
            `Lot_no` varchar(6) NOT NULL,
            `Line` char(5) NOT NULL,
            `Shift` char(1) NOT NULL,
            `Inspection_datetime` datetime NOT NULL,
            `Range_sampling` varchar(19) NOT NULL,
            `NIK` int(5) NOT NULL,
            `Class` char(1) NOT NULL,
            `Status` varchar(6) NOT NULL,
            PRIMARY KEY (`id`),
            UNIQUE KEY `Model` (`Model`,`Serial_number`,`Lot_no`,`Line`)
          ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=44 ;
  
          CREATE TABLE IF NOT EXISTS `Employee` (
        `NIK` char(5) NOT NULL,
        `name` varchar(50) NOT NULL,
        PRIMARY KEY (`NIK`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  </code></pre>