
February 10th, 2000, 12:55 AM
|
|
Junior Member
|
|
Join Date: Jan 2000
Posts: 25
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I hope I can explan this properly. I've got an app where you can assign an item to several different categories. The category information (id,cat name and cat icon) is in it's own table and is not changed - just read. Each item can be part of one or more categories and each category has it's own icon. When displayed, you would see the item listed and the icons representing each category the item belongs to. The only table being written to is the one that contains the array info (item 1 is part of cats 2,4 and 5, etc).
My problem is that I'm trying to list all the items and the category icons without resorting to case statements or if/then statements as there are over 15 categories and it takes a long time to run through all the arrays and list everything. Using in the myAdmin tool to query the db, I can use the
query below and it works fine...
select selected,icon from selections,categories where selections.sid=$variable and
selections.selected=categories.catID
however, when I stick into a php/mySQL select it bombs telling me '0 is not a valid....'. I'm guessing it has something to do with the last part of the select but can't begin to guess what I'm missing or how to fix it.
Any help would be greatly appreciated - I'd sure like to dump those big if statements! Thanks and sorry for the longish explanation.
bob
|