RE: [PHP] Retrieving and Printing Categories
| From: | PHPBeginner.com | Date: | Wed, 25 Apr 2001 14:16:50 +0000 |
| Subject: | RE: [PHP] Retrieving and Printing Categories | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-general+get-50300@lists.php.net to get a copy of this message | ||
well, as long as they are related to each other ..
just a quick SQL,
SELECT
groupName,
title
FROM
table
WHERE
this='is what I need'
GROUP BY
groupName
ORDER BY
groupName,
title
this ( I already know I was wrong in this example) will select you the
categories and it's members.
Just try to play with it for a while and you'll arrive to a solution,
with two tables it is still the same.
Just remember : use SQL to do it, not PHP. With PHP there's more job to do
and with it overhead.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim@phpbeginner.com
www.phpbeginner.com
-----Original Message-----
From: Jordan Elver [mailto:jjelver@worldsites.net]
Sent: Wednesday, April 25, 2001 10:31 PM
To: PHP Database Mailing List; PHP General Mailing List
Subject: [PHP] Retrieving and Printing Categories
Hi,
I've got a load of records that are in different categories.
What is the best way to get all the records or selected records and print
them in such a way that they are grouped (on the page) in their relevent
category, like:
Fruit
-> Apples
-> Pears
-> Bananas
Vegetables
-> Carrots
-> Cabbages
etc, etc.
Sometime my categories are ina dfferent table, don't know if this matters?
How can I do this?
TIA,
Jord
--
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