I went through all the questions on SOF and did my homework but still couldn’t find or understand what I am looking for now I have 2 tables ‘category’ and ‘subcategory’ they are like:
category:
id (int)
title (varchar)
description (varchar)
subcategory
id (int)
cid (int) // This is same as category id.
title (varchar)
description (varchar)
now I want to join and group both of them how do I do it like this
#category1
-subcat1.1
-subcat1.2
#category2
-subcat2.1
-subcat2.2
and so on..
and I also have seen people call there values like $row['cat.title'] for category title and $row['subcat.title'] as subcategory title and so on.. I think they use ‘as’ or something like that can anyone help please? I am using php to do the queries.
1 Answer