src/xPDO/xPDO.php
public function getValue($stmt, $column= null) {
        $value = null;
        if (is_object($stmt) && $stmt instanceof \PDOStatement) {
            $tstart = microtime(true);
            if ($stmt->execute()) {
                $this->queryTime += microtime(true) - $tstart;
                $this->executedQueries++;
                $value= $stmt->fetchColumn($column);
                $stmt->closeCursor();
            } else {
                $this->queryTime += microtime(true) - $tstart;
                $this->executedQueries++;
                $this->log(xPDO::LOG_LEVEL_ERROR, "Error " . $stmt->errorCode() . " executing statement: \n" . print_r($stmt->errorInfo(), true), '', __METHOD__, __FILE__, __LINE__);
            }
        } else {
            $this->log(xPDO::LOG_LEVEL_ERROR, "No valid PDOStatement provided to getValue", '', __METHOD__, __FILE__, __LINE__);
        }
        return $value;
    }
public function getValue($stmt, $column= null) {
        $value = null;
        if (is_object($stmt) && $stmt instanceof \PDOStatement) {
            $tstart = microtime(true);
            if ($stmt->execute()) {
                $this->queryTime += microtime(true) - $tstart;
                $this->executedQueries++;
                $value= $stmt->fetchColumn($column);
                $stmt->closeCursor();
            } else {
                $this->queryTime += microtime(true) - $tstart;
                $this->executedQueries++;
                $this->log(xPDO::LOG_LEVEL_ERROR, "Error " . $stmt->errorCode() . " executing statement: \n" . print_r($stmt->errorInfo(), true), '', __METHOD__, __FILE__, __LINE__);
            }
        } else {
            $this->log(xPDO::LOG_LEVEL_ERROR, "No valid PDOStatement provided to getValue", '', __METHOD__, __FILE__, __LINE__);
        }
        return $value;
    }
public function getValue ( $ stmt , $ column = null ) { $ value = null ; if ( is_object ( $ stmt ) && $ stmt instanceof \ PDOStatement ) { $ tstart = microtime ( true ) ; if ( $ stmt -> execute ( ) ) { $ this -> queryTime += microtime ( true ) - $ tstart ; $ this -> executedQueries ++ ; $ value = $ stmt -> fetchColumn ( $ column ) ; $ stmt -> closeCursor ( ) ; } else { $ this -> queryTime += microtime ( true ) - $ tstart ; $ this -> executedQueries ++ ; $ this -> log ( xPDO :: LOG_LEVEL_ERROR , "Error " . $ stmt -> errorCode ( ) . " executing statement: \n" . print_r ( $ stmt -> errorInfo ( ) , true ) , '' , __METHOD__ , __FILE__ , __LINE__ ) ; } } else { $ this -> log ( xPDO :: LOG_LEVEL_ERROR , "No valid PDOStatement provided to getValue" , '' , __METHOD__ , __FILE__ , __LINE__ ) ; } return $ value ; }
Execute a PDOStatement and get a single column value from the first row of the result set.

@param \PDOStatement $stmt A prepared PDOStatement object ready to be executed.
@param null|integer $column 0-indexed number of the column you wish to retrieve from the row. If
null or no value is supplied, it fetches the first column.
@return mixed The value of the specified column from the first row of the result set, or null.
Execute a PDOStatement and get a single column value from the first row of the result set .