Hi,
i have a code that will look get all the sub categories of the category, it might be 3 levels might be 4 who knows.
Here is my code, the only problem i am having is that $where displays nothing, it is empty.
function recursive($parent_id) {
$sql = "select cat_id from tablea where parent_id = $parent_id";
$result = mysql_query($sql);
while ($row=mysql_fetch_array($result)) {
$where .=" AND cat_id=". $row[cat_id];
recursive($row[cat_id]);
}
}
recursive($id);
any ideas?