RE: [PHP] i need some help with extracting data from mysql

From: Date: Thu, 10 May 2001 16:09:50 +0000
Subject: RE: [PHP] i need some help with extracting data from mysql
Groups: php.general 
Request: Send a blank email to php-general+get-52315@lists.php.net to get a copy of this message
-----Original Message----- From: Steve Werby [mailto:steve-lists@befriend.com] Sent: 10 May 2001 17:04 To: Sandeep Hundal; php Subject: Re: [PHP] i need some help with extracting data from mysql "Sandeep Hundal" <sandeep_wde@yahoo.com> 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

« previous php.general (#52315) next »