Hello Experts, I have been trying but I cannot get it right. I have two tasks to accomplish with xml and php and I am stucked now with these two.
I am building a web page that combines xml from a third party (mercadolibre.com, an eBay clone) and my app's db. Right now I need to do two things. First, I need to display all the items that are stored in my database which are children of a given category. Second, I need to place the corresponding breadcrumbs before the current category.
This is the XML_url: http://www.mercadolibre.com.mx/jm/categsXml?as_site_id=MLM
Let us say that my_db_table looks like this:
item_num; mercadolibre_item_num; mercadolibre_category;
1; 000000001; 9728;
2; 000000002; 7655;
3; 000000003; 123151;
4; 000000004; 39161;
So if I access the page http://www.mywebapp.com/products.php?cat_id=1658
I would like to display something like this:
Start > Computación > Tarjetas de TV // 'Tarjetas de TV' (is cat= 1658) and Computación is (is cat= 1648) which is the parent of 1658. Notice there are no grandparents in which case I would like to display before Computación.
000000004 //from category 39161 is a child of 1658
000000002 //from category 7655 which is a child 9728 and grandson of 1658
000000001 //from category 1658 which is the cat being subject
//since cat 123151 is not a sub category of 1658 I do not want to show 000000003
Please help, I am getting crazzzzy.