Horde_Db_Adapter_Pdo_Base::selectValue PHP Method

selectValue() public method

Returns a single value from a record
public selectValue ( string $sql, mixed $arg1 = null, string $arg2 = null ) : string
$sql string
$arg1 mixed Either an array of bound parameters or a query name.
$arg2 string If $arg1 contains bound parameters, the query name.
return string
    public function selectValue($sql, $arg1 = null, $arg2 = null)
    {
        $stmt = $this->execute($sql, $arg1, $arg2);
        if (!$stmt) {
            return null;
        }
        $result = $stmt->fetchColumn(0);
        // Required to really close the connection.
        $stmt = null;
        return $result;
    }