PHP5/Need help how to get product
QUESTION: Hi,how are you?I would like to ask for a help.I would like to get products where products belong to category and subcategory.This is the tables i got.
categories table :
Thanks a lot.
ANSWER: Hello handoyo,
Could you please be specific ?
Also, which is the category table and which is the sub category, because i can't find any 'subcategory' name in the tables given.
---------- FOLLOW-UP ----------
QUESTION: Hi,the category and the subcategory was in the same table.the category id and the parent id.thanks
My apologies that i am unable to get you clearly. Anyhow, i am assuming that you are asking about how to select similar data from two columns from a table.
If so, that would be like the following.
select product from categories_table where category_id=value and parent_id=value;
select * from planets where solar_system='earth' and universe='earth';
assuming, the table is named as 'planets'. And, there are two columns named solar_system and universe.
The above command fetches the planets that are present both in 'solar_system' field and 'universe' field.
If the above mentioned were not the one you are trying to ask, feel free to write back to me, more briefly. Attach snaps if possible.
Thank You and all the best.