public function execute( $query, array $data = [ ] )
    {
        $result = NULL;

        $statement = $this->database->prepare( $query );

        if ( FALSE === $statement )
        {
            $this->close();

            throw new DatabaseException( 'Failed to create prepared statement.' );
        }

        $result = $statement->execute( $data );

        $this->query = $statement->queryString;

        if ( FALSE !== $result )
        {
            $result = ( int ) $statement->rowCount();
        }

        return $result;
    }
public function execute( $query, array $data = [ ] )
    {
        $result = NULL;

        $statement = $this->database->prepare( $query );

        if ( FALSE === $statement )
        {
            $this->close();

            throw new DatabaseException( 'Failed to create prepared statement.' );
        }

        $result = $statement->execute( $data );

        $this->query = $statement->queryString;

        if ( FALSE !== $result )
        {
            $result = ( int ) $statement->rowCount();
        }

        return $result;
    }
public function execute ( $ query , array $ data = [ ] ) { $ result = NULL ; $ statement = $ this -> database -> prepare ( $ query ) ; if ( FALSE === $ statement ) { $ this -> close ( ) ; throw new DatabaseException ( 'Failed to create prepared statement.' ) ; } $ result = $ statement -> execute ( $ data ) ; $ this -> query = $ statement -> queryString ; if ( FALSE !== $ result ) { $ result = ( int ) $ statement -> rowCount ( ) ; } return $ result ; }
Executes a database query which does not return a value.

@param string $query the query
@param array  $data

@return bool|int number of affected rows on success, FALSE on failure

@throws DatabaseException
Executes a database query which does not return a value .