function deleteAllSpec($cat_id) { $productCatSpec = new productcatspec(); $productCatSpec->where('productcat_id', $cat_id); $productCatSpec->get(); $productCatSpec->delete_all(); }