futrose Posted February 9, 2011 Share Posted February 9, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/227155-assign-a-page-to-multiple-categories/ Share on other sites More sharing options...
Muddy_Funster Posted February 10, 2011 Share Posted February 10, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/227155-assign-a-page-to-multiple-categories/#findComment-1172242 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.