public function execQuery($statement, $params = array()) {
        $start = microtime(true);
        $query = $this->prepare($statement.'');
        try {
            $query->execute($params);
        } catch (\PDOException $e){
            $this->error($e->getMessage(), array(
                'File' => __FILE__,
                'Line' => __LINE__ - 4,
                'Query' => $statement .'',
                'Params' => $params,
                'Trace' => $e->getTraceAsString()
            ));
            return 0;
        }
        $this->debug($statement, array(
            'params' => $params,
            'execute' => true,
            'rows' => $count = $query->rowCount(),
            'time' => microtime(true) - $start,
            'dns' => $this->dns
        ));
        return $count;
    }
public function execQuery($statement, $params = array()) {
        $start = microtime(true);
        $query = $this->prepare($statement.'');
        try {
            $query->execute($params);
        } catch (\PDOException $e){
            $this->error($e->getMessage(), array(
                'File' => __FILE__,
                'Line' => __LINE__ - 4,
                'Query' => $statement .'',
                'Params' => $params,
                'Trace' => $e->getTraceAsString()
            ));
            return 0;
        }
        $this->debug($statement, array(
            'params' => $params,
            'execute' => true,
            'rows' => $count = $query->rowCount(),
            'time' => microtime(true) - $start,
            'dns' => $this->dns
        ));
        return $count;
    }
public function execQuery ( $ statement , $ params = array ( ) ) { $ start = microtime ( true ) ; $ query = $ this -> prepare ( $ statement . '' ) ; try { $ query -> execute ( $ params ) ; } catch ( \ PDOException $ e ) { $ this -> error ( $ e -> getMessage ( ) , array ( 'File' => __FILE__ , 'Line' => __LINE__ - 4 , 'Query' => $ statement . '' , 'Params' => $ params , 'Trace' => $ e -> getTraceAsString ( ) ) ) ; return 0 ; } $ this -> debug ( $ statement , array ( 'params' => $ params , 'execute' => true , 'rows' => $ count = $ query -> rowCount ( ) , 'time' => microtime ( true ) - $ start , 'dns' => $ this -> dns ) ) ; return $ count ; }
Executes a statement and returns the number of affected rows.
@param string $statement
@param array $params
@return int
@throws \PDOException
Executes a statement and returns the number of affected rows .