When I sell a PhpBB forum with the member database, would that be legal? For example, what if the buyer uses members e-mail addresses to advertise?
You should be allowed to sell the database as you made the forum meaning you have rights to sell the database.
Just the selling point of selling the database wouldn't be legal nor illegal for transferring the forum database to another party. If you intend on selling the database for the purpose of selling the email addresses then that could be a problem if you don't have the users permission to do so. If the person purchasing the forum from you does it as a whole then to me, there's a gray area when it comes to advertising to the users.