Mistři v programování na #hovnokod

/**
* nahrada auto_increment
* @param string $name - tabulka
* @param string $id - idecko
* @param ADODB-object $db - ADOConnection
*
* @return int - nove ID, nebo false
*/
function CountId($name, $id, & $db)
{
    $selection = $db->Execute('SELECT MAX('.$id.') as id
                               FROM '.$name);
    if ($selection) {
        return ($selection->fields['id'] + 1);
    } else {
        return false;
    }
}

Anonymous,