Page 1 of 1

Problem to rename Table SQL phpbb_users

Posted: Wed May 22, 2019 1:00 am
by Feofilaktt
Hello everyone,

I'm having a problem renaming the SQL users table.

I have already made the changes in "site/includes/constants.php":

Code: Select all

define ('USERS_TABLE', $ table_prefix. 'users');
to

Code: Select all

define ('USERS_TABLE', $ table_prefix. 'players');
But when you log in to the site, a problem occurs in the database.
Capturar.JPG
Funny that when you access the site, the anonymous user works because I can usually access the site.

But when connected with other user, this problem occurs in the table.

Any idea what this might be?

Re: Problem to rename Table SQL phpbb_users

Posted: Wed May 22, 2019 1:23 am
by </Solidjeuh>
I don't think renaming a database table is that simple, and that table is being used by many other things. And what about extensions? You will get problems when installing extensions that use or need that table...

Re: Problem to rename Table SQL phpbb_users

Posted: Wed May 22, 2019 2:11 am
by EA117
If you hadn't already, also purge your cache in case there are still cache files built with the previous constant. If you cannot access ACP to invoke the purge, use FTP to delete or rename the /production subdirectory under /cache, so that it will be re-created.

If you don't mind sharing, what practical purpose or need does renaming the table provide, when the data within that table is still exactly to meet phpBB requirements and specifications? i.e. Who's problem is "fixed" by renaming the phpbb_users table, when phpBB is still the one that needs to access this table, for the uniquely phpBB-formatted user information that it contains? This seems like something the actual users never see, and something any code that needs to access the table doesn't care about (i.e. doesn't care if the name is "users").

Because I agree with Solidjeuh, renaming the table seems like a bad idea; and is just asking for long-term third-party trouble and/or future phpBB install / update / migration module trouble. Seemingly, without receiving any significant benefit in return.

Re: Problem to rename Table SQL phpbb_users

Posted: Wed May 22, 2019 3:09 am
by 3Di
Renaming the constant creates only troubles you hardly can fix.

The newly added core code, starting from 3.2.0 is not anymore based on constants but services (see: container).

You are simply getting into troubles with notifications, user loader, text reparser, auth (permissions), posts' content visibility etc.. etc..

Not to mention the extensions which are using the container instead of constants to query the tables.

And yes, you can purge the cache `ad infinitum`.. to no success.

Re: Problem to rename Table SQL phpbb_users

Posted: Wed May 22, 2019 3:33 am
by Feofilaktt
I understand ... I will try other ways to achieve this goal.

My intention is to join in a same table the connection between a game server and PhPBB.

Since I can not modify the source code of the server, I thought about modifying the PhPBB table to communicate with the server.

This is my website: https://diablo.grupoblackwolf.com.br/

Re: Problem to rename Table SQL phpbb_users

Posted: Wed May 22, 2019 3:37 am
by 3Di
You simply can't do it without an extension to be made.

Moreover, I know the Blizzards' API (Diablo, Wow etc..) and that's doable only joining custom tables.
See: https://rhea.phpbbstudio.com/builds