-----Original Message-----
From: Steve Werby [mailto:[EMAIL PROTECTED]]
Sent: 10 May 2001 17:04
To: Sandeep Hundal; php
Subject: Re: [PHP] i need some help with extracting data from mysql
"Sandeep Hundal" <[EMAIL PROTECTED]> wrote:
> i've got a simple problem, yet it doesn't work, so i hope someone can
> help me out here.
>
> i've got a table with id, group, and name. each group has many names
> ofcourse.
Are these *all* of the field names?
Sorry, some typo errors, i got confused. The field names are : id, group,
name, approved.
> now i need to output the data like :
> > group1
> >name1
> >name2
> >name3
>
> >group2
> >name4
> >name5
>
> >group3
> >name6
> etc........
>
> my query is "SELECT group, name FROM $tablename WHERE approved='yes'
> GROUP BY folder ORDER BY folder;
Sorry, substitute folder for Group. I just wrote that by mistake.
Data is such:
1 | friends | name1 | yes
2 | misc | name2 | yes
3 | friends | name3 | yes
4 | work | name4 | no
I want to extract the ones approves, but list them by Group first, and all
the relevant names after. But I dont want to run a query for each GROUP to
output the data underneath it.
TIA
/sunny
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]