Re: [PHP] How to fetch a group by Query?

2001-07-11 Thread Chris Lambert - WhiteCrown Networks
Couldn't you just do something like: ? $rows = mysql_query(SELECT * FROM table ORDER BY category, title); while ($row = mysql_fetch_array($rows)) { if ($row[title] $last) print b$row[category]/bbr\r\n; print li$row[title]/libr\r\n; $last = $row[title]; } ? /* Chris Lambert,

[PHP] How to fetch a group by Query?

2001-07-10 Thread Frédéric Mériot
Hello (again) I've got a query which extract titles and categories with a group by on the categorie. Is there a simple way to display rows like this (without doing a second query ): Categorie A -titi -toto -tutu Categorie B -bibi -nini -fififi Categorie C -titi

RE: [PHP] How to fetch a group by Query?

2001-07-10 Thread Ben Bleything
Did you try 'SELECT categorie,item FROM your_table GROUP BY categorie'? Ben -Original Message- From: Frédéric Mériot [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 5:41 AM To: PHP General List Subject: [PHP] How to fetch a group by Query? Hello (again) I've got a query which

Re: [PHP] How to fetch a group by Query?

2001-07-10 Thread David Robley
On Tue, 10 Jul 2001 22:10, Frédéric Mériot wrote: Hello (again) I've got a query which extract titles and categories with a group by on the categorie. Is there a simple way to display rows like this (without doing a second query ): Categorie A -titi -toto -tutu Categorie B