public function check($table, $colname, $val){
    $oldvals = $this->readdb($table, $colname);

        if($oldvals && is_array($oldvals)){
        $oldvals = array_flip($oldvals);
        }

        if(isset($oldvals[$val])){
        return true;
        }

    return false;
    }