src/DBConnect.php
public function getFieldValue(string $field_name)
    {
        try {
            $value = null;
            $fields = $this->stmt->fetch(\PDO::FETCH_ASSOC);
            if (array_key_exists($field_name, $fields)) {
                $value = $fields[$field_name];
            } else {
                throw new \Exception("Field '$field_name' is not present in the current result set.\n");
            }
            return $value;
        } catch (\PDOException $e) {
            die('Error: ' . $e->getMessage());
        } catch (\Exception $e) {
            die("Error: " . $e->getMessage());
        }
    }
public function getFieldValue(string $field_name)
    {
        try {
            $value = null;
            $fields = $this->stmt->fetch(\PDO::FETCH_ASSOC);
            if (array_key_exists($field_name, $fields)) {
                $value = $fields[$field_name];
            } else {
                throw new \Exception("Field '$field_name' is not present in the current result set.\n");
            }
            return $value;
        } catch (\PDOException $e) {
            die('Error: ' . $e->getMessage());
        } catch (\Exception $e) {
            die("Error: " . $e->getMessage());
        }
    }
public function getFieldValue ( string $ field_name ) { try { $ value = null ; $ fields = $ this -> stmt -> fetch ( \ PDO :: FETCH_ASSOC ) ; if ( array_key_exists ( $ field_name , $ fields ) ) { $ value = $ fields [ $ field_name ] ; } else { throw new \ Exception ( "Field '$field_name' is not present in the current result set.\n" ) ; } return $ value ; } catch ( \ PDOException $ e ) { die ( 'Error: ' . $ e -> getMessage ( ) ) ; } catch ( \ Exception $ e ) { die ( "Error: " . $ e -> getMessage ( ) ) ; } }
Returns field's value

@param  string $field_name Field's name
@return mixed              Field's value
Returns field s value