コード例 #1
0
ファイル: catmgr.php プロジェクト: CatBerg-TestOrg/coppermine
function verify_children($parent, $cid)
{
    global $CONFIG, $children;
    $sql = "SELECT cid FROM {$CONFIG['TABLE_CATEGORIES']} WHERE parent = {$parent}";
    $result = cpg_db_query($sql);
    if (($cat_count = $result->numRows()) > 0) {
        while ($row = $result->fetchAssoc()) {
            $children[] = $row['cid'];
            verify_children($row['cid'], $cid);
        }
    }
    $result->free();
    return false;
}
コード例 #2
0
ファイル: catmgr.php プロジェクト: phill104/branches
function verify_children($parent, $cid)
{
    global $CONFIG, $children;
    $sql = "SELECT cid " . "FROM {$CONFIG['TABLE_CATEGORIES']} " . "WHERE parent = '{$parent}' ";
    $result = cpg_db_query($sql);
    if (($cat_count = mysql_num_rows($result)) > 0) {
        while ($row = mysql_fetch_array($result)) {
            $children[] = $row['cid'];
            // call this function again to this this
            // child's children
            verify_children($row['cid'], $cid);
        }
    }
    return false;
}