Jump to content

Recommended Posts

I'm not sure if this should be under the PHP code help or here so I apologize in advance if it's in the wrong spot.

 

What I am wondering is how would I go about assigning a page on my site to multiple categories in my navigation links?  I have a different website for work (we bought x-cart) and I saw that in the mysql product table that an item had 18/27 in the category field.  This means the product could go under the soy candles or votive candles categories.  The item was a soy votive candle.  I'm having a hard time finding the code that set this up in the db. 

 

The way I have it set up right now is that when a new page is created by the admin he/she can click on a selection from a dropdown list which is populated with all the available categories, but only one can be selected at a time.  If a second one is selected it just overwrites the first in the database.

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/227155-assign-a-page-to-multiple-categories/
Share on other sites

This kind of thing is commonly done by having a an aditional cross index table that draws from both the item and catagory table primary indexes.  this allows the table to have multiple entries for each catagory and item which can the be refferenced through php page.  so your PHP looks up the cross index table for the item code and reads all catagory entries that it is assigned to and then lists the item under those catagories.

 

That's just the common way of doing it, I don't know how it works on your system, but I hope that gives you somewhere to start.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.