Hi,

I have a category_table with the fields like below:

id
category_name
parent


To get the Category Name and its parent name, we can use the simple but bad way like below:

$query=mysql_query("Select * from category_table where category_name like '%tech%'");
while($row=mysql_fetch_array($query)){

$query2=mysql_query(""Select * from category_table where parent ='".$row['id']."'");

}
May I know how to get the category name with its parent name in one query?