OK this is getting confusing so I decided to write a new question.
I need to check if a row in my category table is a child category. I then need to check which parent category the child is part of?
A parent category has a categoryID and a ParentCategoryID of 0 A child category has a categoryID and a ParentCategoryID eg 30.
Category Table:
ID PCID NAME
10 0 Computers
11 10 Software
12 10 Hardware
This is what Ive tried:
This will display the parent categories(because PCID 0 is the parent):
SELECT CategoryID, ParentCategoryID, Name, Published, Deleted, PictureID
FROM Nop_Category
WHERE (Deleted = 0)
AND (Published = 1)
AND (ParentCategoryID = 0)