Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Display Product List With Multiple Categories Inside Listbox

Status
Not open for further replies.

realayumi

Technical User
Dec 14, 2009
3
ID
Hi all, sorry for my bad English, and this is my first post.

Here is my story.
Basically Data input from browser by mySQL and PHP, with many detail.
But if we want to edit all the price will take long time to finish. So i choose Access to edit just a view important data.
Like Price, and SKU. So i can see which manufacture, what SKU, price and each product have multiple categories.
I already display product list with name, SKU, price, manufacture name.

The problem is, i cant display each product's multiple categories in Listbox i made.
Because 1 product have 2 or 3 categories, maybe more.
So in the listbox i just want to show only each products' categories and i dont want to edit the categories.
How can we display each product's categories?

I'm using Continuous Forms
Anything you can change except mySQL database fields.
I understand mySQL just little, and i'm new in Access.

I already attach 5 files:
3 images (relationships, form design, form view)
1 mySQL data
1 mdb

Actualy, in PHP, the query between product list and category is separated.

First, PHP query the product list, then in PHP script, when it list the product rows, it query category_name and take product_id from product.
Here is from PHP:

Code:
Code:
 $db_cat->query("SELECT #__{vm}_category.category_id, category_name FROM

       #__{vm}_category,#__{vm}_product_category_xref

      WHERE #__{vm}_category.category_id=#__{vm}_product_category_xref.category_id

      AND #__{vm}_product_category_xref.product_id='".$db->f("product_id") ."'");



while($db_cat->next_record()) {

	$tmpcell .= $db_cat->f("category_name") . "<br/>";

}

See image below, if missing, see my attachment for product listing looks like. I mark it with red.

mhwx7l.png


And my plan is like image below.
Its not real, i edit with PhotoShop, to make more easy to explain.

2gt12jn.png

--------------------
Microsoft Access 2000
mySQL 5.0.45
ODBC Driver 3.5 and 5.1
 
You can build a query that concatenates the multiple categories into a single string, Faq701-3499. You should be able to modify the code and instead of adding a "," add a vbcrlf between categories
 
You may also have a look here:
faq701-4233

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Use the one PHV posted. I meant to post that one, but posted the wrong FAQ.
 
I already read that, but i dont understand access coding. Where to put that? Can you please help me edit the file i attached?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top