DJJob.php
public static function runUpdate($sql, $params = array()) {
        for ($attempts = 0; $attempts < self::$retries; $attempts++) {
            try {
                $stmt = self::getConnection()->prepare($sql);
                $stmt->execute($params);
                return $stmt->rowCount();
            }
            catch (PDOException $e) {
                // Catch "MySQL server has gone away" error.
                if ($e->errorInfo[1] == 2006) {
                    self::$db = null;
                }
                // Throw all other errors as expected.
                else {
                    throw $e;
                }
            }
        }

        throw new DJException("DJJob exhausted retries connecting to database");
    }
public static function runUpdate($sql, $params = array()) {
        for ($attempts = 0; $attempts < self::$retries; $attempts++) {
            try {
                $stmt = self::getConnection()->prepare($sql);
                $stmt->execute($params);
                return $stmt->rowCount();
            }
            catch (PDOException $e) {
                // Catch "MySQL server has gone away" error.
                if ($e->errorInfo[1] == 2006) {
                    self::$db = null;
                }
                // Throw all other errors as expected.
                else {
                    throw $e;
                }
            }
        }

        throw new DJException("DJJob exhausted retries connecting to database");
    }
public static function runUpdate ( $ sql , $ params = array ( ) ) { for ( $ attempts = 0 ; $ attempts < self :: $ retries ; $ attempts ++ ) { try { $ stmt = self :: getConnection ( ) -> prepare ( $ sql ) ; $ stmt -> execute ( $ params ) ; return $ stmt -> rowCount ( ) ; } catch ( PDOException $ e ) { // Catch "MySQL server has gone away" error. if ( $ e -> errorInfo [ 1 ] == 2006 ) { self :: $ db = null ; } // Throw all other errors as expected. else { throw $ e ; } } } throw new DJException ( "DJJob exhausted retries connecting to database" ) ; }
Runs an update query against the database.

@param string $sql The query to execute.
@param array $params The params necessary for the prepared statement.

@return int The amount of affected rows.
@throws DJException Throws if the query couldn't be executed.
Runs an update query against the database .