View Single Post
Old 06-04-2008, 02:11 PM   #2 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

I think you can achieve this by just using MySQL:
here is my test table:

Code:
mysql> select * from test;
+----+------------------+----------+------------+--------+
| id | title            | criteria | date       | status |
+----+------------------+----------+------------+--------+
|  1 | Staff research   | M3       | 2008-03-12 | Pass   |
|  2 | Staff research   | M2       | 2008-03-12 | Pass   |
|  3 | Staff research   | M1       | 2008-03-12 | Pass   |
|  4 | Staff research   | P3       | 2008-03-12 | Pass   |
|  5 | Staff research   | P2       | 2008-03-12 | Pass   |
|  6 | Staff research   | P1       | 2008-03-12 | Pass   |
|  7 | Games techniques | P6       | 2007-12-03 | Merit  |
|  8 | Games techniques | P5       | 2007-12-03 | Merit  |
|  9 | Games techniques | P4       | 2007-12-03 | Merit  |
| 10 | Staff research   | D3       | 2008-03-12 | Pass   |
| 11 | Staff research   | D2       | 2008-03-12 | Pass   |
| 12 | Staff research   | D1       | 2008-03-12 | Pass   |
+----+------------------+----------+------------+--------+
12 rows in set (0.00 sec)
i ran this query:
sql Code:
SELECT `title`, GROUP_CONCAT(criteria  SEPARATOR ',') AS `critList`, `date`, `status` FROM `test` WHERE `title` = 'Games techniques' GROUP BY `title`;

Returns:
Code:
+------------------+----------+------------+--------+
| title            | critList | date       | status |
+------------------+----------+------------+--------+
| Games techniques | P6,P5,P4 | 2007-12-03 | Merit  |
+------------------+----------+------------+--------+
1 row in set (0.00 sec)
hope that helps
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)

Last edited by sketchMedia : 06-04-2008 at 02:46 PM. Reason: added ` to query to stop geshi messing it up
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
Dracula (06-05-2008)