как и полагается, монстро-SEF генерит кучу запросов. подскажите плиз чего написать чтоб одним запросом вытянуть сразу несколько данных. пример: собсо вот что имеем: Код (CODE): 45: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='1' AND jos_vm_category.category_id='1' 46: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='2' AND jos_vm_category.category_id='2' 47: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='3' AND jos_vm_category.category_id='3' 48: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='4' AND jos_vm_category.category_id='4' 49: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='5' AND jos_vm_category.category_id='5' 50: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='14' AND jos_vm_category.category_id='14' 51: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='34' AND jos_vm_category.category_id='34' 52: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='32' AND jos_vm_category.category_id='32' 53: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='1' AND jos_vm_category.category_id='1' 54: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='33' AND jos_vm_category.category_id='33' 55: SELECT category_id, category_name,category_parent_id FROM jos_vm_category, jos_vm_category_xref WHERE jos_vm_category_xref.category_child_id='2' AND jos_vm_category.category_id='2' вот код, который нужно поправить: Код (CODE): function create_category_path($category_id) { global $database; $vmsefpath = ''; do { $q = "SELECT category_id, category_name,category_parent_id FROM #__".VM_TABLEPREFIX."_category, #__".VM_TABLEPREFIX."_category_xref WHERE "; $q .= "#__".VM_TABLEPREFIX."_category_xref.category_child_id='$category_id' "; $q .= "AND #__".VM_TABLEPREFIX."_category.category_id='$category_id'"; $database->setQuery($q); $database->loadObject($row); if ($row->category_parent_id) { $link = sefencode($row->category_name); $vmsefpath = '/'. $link. $vmsefpath; } else { $link = sefencode($row->category_name); $vmsefpath = $link . $vmsefpath; } $category_id = $row->category_parent_id; } while ($row->category_parent_id<>0); return $vmsefpath; } как написать, чтоб одним запросов вытянуть сразу все эти id.