public function update_user_password($user, $host = '%', $password = null, $password_format_mysql = false) {
		if ($password == null) {
			$password = md5(mt_rand() . microtime());
		}

		if ($password_format_mysql) {
			$password = $this->quote($password);
		} else {
			$password = 'PASSWORD(' . $this->quote($password) . ')';
		}

		$query = 'SET PASSWORD FOR ' . $this->quote_identifier($user) . '@' . $this->quote($host) . ' = ' . $password;
		$statement = $this->get_statement($query);
		$statement->execute();

		$query = 'FLUSH PRIVILEGES';
		$statement = $this->get_statement($query);
		$statement->execute();
	}
public function update_user_password($user, $host = '%', $password = null, $password_format_mysql = false) {
		if ($password == null) {
			$password = md5(mt_rand() . microtime());
		}

		if ($password_format_mysql) {
			$password = $this->quote($password);
		} else {
			$password = 'PASSWORD(' . $this->quote($password) . ')';
		}

		$query = 'SET PASSWORD FOR ' . $this->quote_identifier($user) . '@' . $this->quote($host) . ' = ' . $password;
		$statement = $this->get_statement($query);
		$statement->execute();

		$query = 'FLUSH PRIVILEGES';
		$statement = $this->get_statement($query);
		$statement->execute();
	}
public function update_user_password ( $ user , $ host = '%' , $ password = null , $ password_format_mysql = false ) { if ( $ password == null ) { $ password = md5 ( mt_rand ( ) . microtime ( ) ) ; } if ( $ password_format_mysql ) { $ password = $ this -> quote ( $ password ) ; } else { $ password = 'PASSWORD(' . $ this -> quote ( $ password ) . ')' ; } $ query = 'SET PASSWORD FOR ' . $ this -> quote_identifier ( $ user ) . '@' . $ this -> quote ( $ host ) . ' = ' . $ password ; $ statement = $ this -> get_statement ( $ query ) ; $ statement -> execute ( ) ; $ query = 'FLUSH PRIVILEGES' ; $ statement = $ this -> get_statement ( $ query ) ; $ statement -> execute ( ) ; }
Update a user's password


@access public
@param string $user name of the user that should be updated
@param string $host host the user will be connecting from, defaults to '%'
@param string $password the new password of the user, if it is omitted, a random password will be created
Update a user s password