Sandeep,

Try:

$sql="SELECT group, name FROM $tablename WHERE approved='yes'
ORDER BY group, name";

Don't know what fieldname "folder" is in your original SQL.  You said that
the table had only id, group, & name.  But I note that you must also have a
fieldname called "approved".

In any case, assuming the fieldnames are correct, the above should work.

kind regards,

bill hollett


Sandeep Hundal wrote:

> hi all,
>
> 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.
>
> 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;
>
> yet the ouput can't seem to handle more than 1 name per group.
>
> any ideas?? thanks in advance!
>
> /sunny
>
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
>
> --
> 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]


-- 
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]

Reply via email to