Re: i need some help with extracting data from mysql
| From: | bill | Date: | Thu, 10 May 2001 13:58:17 +0000 |
| Subject: | Re: i need some help with extracting data from mysql | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52279@lists.php.net to get a copy of this message | ||
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: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net