public function exists($field, $val)
    {
        $db = $this->load();
        $result = false;
        foreach ($db as $index => $row) {
            if ($row[$field] === $val) {
                $result = true;
            }
        }
        return $result;
    }
public function exists($field, $val)
    {
        $db = $this->load();
        $result = false;
        foreach ($db as $index => $row) {
            if ($row[$field] === $val) {
                $result = true;
            }
        }
        return $result;
    }
public function exists ( $ field , $ val ) { $ db = $ this -> load ( ) ; $ result = false ; foreach ( $ db as $ index => $ row ) { if ( $ row [ $ field ] === $ val ) { $ result = true ; } } return $ result ; }
Checks whether the database contains a field with the specified value.

@param string $field the field name
@param string $val   the value to check the field for
@return boolean      true if the pair exists, otherwise false
Checks whether the database contains a field with the specified value .