src/Db/Client.php
public function execute($statement, $params = array())
    {
        $preparedStmt = null;
        $result = false;

        try {
            $preparedStmt = $this->getConnection()->prepare($statement);
        } catch (PDOException $e) {
            throw new ClientException(
                'Failed to prepare MySQL statement.',
                null,
                $e
            );
        }

        foreach ($params as $name => $paramInfo) {
            if (is_string($paramInfo)) {
                $preparedStmt->bindValue($name, $paramInfo, PDO::PARAM_STR);
            } elseif (is_array($paramInfo)) {
                list($value, $type) = $paramInfo;
                $preparedStmt->bindValue($name, $value, $type);
            }
        }

        try {
            $result = $preparedStmt->execute();
        } catch (PDOException $e) {
            throw new ClientException(
                'Failed to execute MySQL statement.',
                null,
                $e
            );
        }

        return $result;
    }
public function execute($statement, $params = array())
    {
        $preparedStmt = null;
        $result = false;

        try {
            $preparedStmt = $this->getConnection()->prepare($statement);
        } catch (PDOException $e) {
            throw new ClientException(
                'Failed to prepare MySQL statement.',
                null,
                $e
            );
        }

        foreach ($params as $name => $paramInfo) {
            if (is_string($paramInfo)) {
                $preparedStmt->bindValue($name, $paramInfo, PDO::PARAM_STR);
            } elseif (is_array($paramInfo)) {
                list($value, $type) = $paramInfo;
                $preparedStmt->bindValue($name, $value, $type);
            }
        }

        try {
            $result = $preparedStmt->execute();
        } catch (PDOException $e) {
            throw new ClientException(
                'Failed to execute MySQL statement.',
                null,
                $e
            );
        }

        return $result;
    }
public function execute ( $ statement , $ params = array ( ) ) { $ preparedStmt = null ; $ result = false ; try { $ preparedStmt = $ this -> getConnection ( ) -> prepare ( $ statement ) ; } catch ( PDOException $ e ) { throw new ClientException ( 'Failed to prepare MySQL statement.' , null , $ e ) ; } foreach ( $ params as $ name => $ paramInfo ) { if ( is_string ( $ paramInfo ) ) { $ preparedStmt -> bindValue ( $ name , $ paramInfo , PDO :: PARAM_STR ) ; } elseif ( is_array ( $ paramInfo ) ) { list ( $ value , $ type ) = $ paramInfo ; $ preparedStmt -> bindValue ( $ name , $ value , $ type ) ; } } try { $ result = $ preparedStmt -> execute ( ) ; } catch ( PDOException $ e ) { throw new ClientException ( 'Failed to execute MySQL statement.' , null , $ e ) ; } return $ result ; }
Execute a statement, returning boolean true on success.

@param string $statement
@param array $params The keys of the array are the one-indexed parameter
number or the colon-prefixed parameter name. The
values are either a string or an array containing
the value and the data type (i.e. PDO::PARAM_*).

@return boolean

@throws \Droid\Plugin\Mysql\Db\ClientException
Execute a statement returning boolean true on success .