CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 multiple categories

Print topic Send  topic

Author Message
Randy Lane
Posted: 10/15/2002, 11:18 AM

I am designing a web cart system for a client of mine loosely based on the
Bookstore example.

Would anyone have a logical or simple way to set it up so that some of the
items could be viewed from multiple categories. Some of the products my
client sells can belong to several different categories.

Thanks


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.401 / Virus Database: 226 - Release Date: 10/9/2002

michael weaver
Posted: 10/25/2002, 10:31 AM

Hi Randy,

I've done some stuff like this. Just remember to use several tables to link
information together and you should be fine. Most often you can get by with
something along these lines:

Table 1: Products
------------------
product_id
title
description
image
price

Table 2: Categories
------------------
category_id
category_name

Table 3: Products_Categories
------------------
product_id
category_id

When you display products in a category, you should select from
Products_Categories rather than from products. A select statement may start
like this:

SELECT product_id FROM Products_Categories WHERE category_id=X;

Of course, that depends on what db you're using. But from here you can see
that it is selecting all product_id's from Products_Categories where
category_id equals a certain parameter. (The where statement can be taken
care of in the input tab of the grid properties).

The next step is to either change your SQL statement to link up the tables
OR use CC and manually join each one that you want. For example, while still
using the Products_Categories table, add another field for product_id, go
into the properties, and join it to the product table and to the title,
description, image & price. The former way is definitely best (make SQL do
the work once!), but the latter way works too.

Hope that helps!

michael


"Randy Lane" <randynews@crystalimagesoftware.com> wrote in message
news:aohm4t$kpr$1@news.codecharge.com...
> I am designing a web cart system for a client of mine loosely based on the
> Bookstore example.
>
> Would anyone have a logical or simple way to set it up so that some of the
> items could be viewed from multiple categories. Some of the products my
> client sells can belong to several different categories.
>
> Thanks
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.401 / Virus Database: 226 - Release Date: 10/9/2002
>
>

michael weaver
Posted: 10/25/2002, 10:34 AM

Or you could just read the thread "Assigning a Record to Two Categories"
posted by Frank S. on 10/22/2002.

:-)

michael


"michael weaver" <zero@michaelweaver.org> wrote in message
news:apbv54$sep$1@news.codecharge.com...
> Hi Randy,
>
> I've done some stuff like this. Just remember to use several tables to
link
> information together and you should be fine. Most often you can get by
with
> something along these lines:
>
> Table 1: Products
> ------------------
> product_id
> title
> description
> image
> price
>
> Table 2: Categories
> ------------------
> category_id
> category_name
>
> Table 3: Products_Categories
> ------------------
> product_id
> category_id
>
> When you display products in a category, you should select from
> Products_Categories rather than from products. A select statement may
start
> like this:
>
> SELECT product_id FROM Products_Categories WHERE category_id=X;
>
> Of course, that depends on what db you're using. But from here you can see
> that it is selecting all product_id's from Products_Categories where
> category_id equals a certain parameter. (The where statement can be taken
> care of in the input tab of the grid properties).
>
> The next step is to either change your SQL statement to link up the tables
> OR use CC and manually join each one that you want. For example, while
still
> using the Products_Categories table, add another field for product_id, go
> into the properties, and join it to the product table and to the title,
> description, image & price. The former way is definitely best (make SQL do
> the work once!), but the latter way works too.
>
> Hope that helps!
>
> michael
>
>
> "Randy Lane" <randynews@crystalimagesoftware.com> wrote in message
>news:aohm4t$kpr$1@news.codecharge.com...
> > I am designing a web cart system for a client of mine loosely based on
the
> > Bookstore example.
> >
> > Would anyone have a logical or simple way to set it up so that some of
the
> > items could be viewed from multiple categories. Some of the products my
> > client sells can belong to several different categories.
> >
> > Thanks
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.401 / Virus Database: 226 - Release Date: 10/9/2002
> >
> >
>
>

DAVID
Posted: 01/17/2003, 6:59 AM

see my post on multiple
If your site is built with perl, I can send you a not so very well written
patch. In any case it might help you understand the solution.

"Randy Lane" <randynews@crystalimagesoftware.com> wrote in message
news:aohm4t$kpr$1@news.codecharge.com...
> I am designing a web cart system for a client of mine loosely based on the
> Bookstore example.
>
> Would anyone have a logical or simple way to set it up so that some of the
> items could be viewed from multiple categories. Some of the products my
> client sells can belong to several different categories.
>
> Thanks
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.401 / Virus Database: 226 - Release Date: 10/9/2002
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.