I'm in dire need of assistance -- the site I'm working on is one that
I've "inherited" from another developer and have been cleaning up his
code (orignally done in ASP.net) and converting to PHP.

Anyway -- it's a product catalog, and each product is allowed to be in
multiple categories. The "categories" field in the DB is of type "TEXT"
and if there is more than one category for the item to be in, they're
held on separate lines, like such:

4
2
13

and so forth. The products are listed on the page depending on the
links clicked. So:

<a href="catalog.php?cat=1&subcat=2">Widgets</a>

would show the "Widgets" subcategory under whatever main category it's
listed in. But let's say a particular Widget is also allowed to be in
categories 4 and 13 (see list above). I can't say "select * from
products where cat = '1' and subcat contains '2'" because MySQL doesn't
have a "contains" modifier to a SELECT statement.

I tried the "in" modifier, but kept getting an SQL error:

"select * from products where cats = '1' and '2' in subcats"

Any ideas?

Thanks,
-Bob

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to