Exemplo n.º 1
0
/**
 * Generate new cpid for contest
 * @global type $conn
 * @param type $cid 
 * @return type new unused cpid
 */
function gen_new_cpid($cid)
{
    global $conn;
    $rs = new RecordSet($conn);
    $rs->Query("SELECT * FROM contest_problems WHERE cid='{$cid}'");
    $problems_n = $rs->num_rows() + 1000;
    return $problems_n;
}