On Wed, 14 Mar 2007 17:17:30 +0000 (UTC),
"newhorizonhosting.com"
<charles@dieselinteractive.com> wrote:
> I am working on a site that does reviews. On one of my
pages I am needing to
>pull a list of my categories. However I only need one of
each category. as you
>can see from the link below it currently is pulling
everything from my category
>field including duplicates.
>
> Is there a way that I can get this done. I am using DW8
to build my site. I am
>very green at php hand coding.
>
> is this something that should be done in the SQL side or
php?
>
>
http://www.dfwfoodguide.com/reviews2.php
Don't you have a category table with a list of all the
categories? eg
1 Italian
2 Chinese
3 Mexican
4 Greek
etc etc
Then your restaurant table would include a field (say
res_catid) in
which you entered the id of the category it was listed in.
Makes it
easy to get a list of categories from the category table
(there are no
duplicates in it) and also to list all restaurants where
res_catid =
'2' etc.
--
Steve Fleischer
steve at flyingtigerwebdesign dot com
Hong Kong