Get the TABLE number.

Game development with Board Game Arena Studio
Post Reply
User avatar
Rudolf
Posts: 566
Joined: 24 December 2011, 23:04

Get the TABLE number.

Post by Rudolf »

Hello!
Well I've found a trick to get the table numbers using a request on the table and extracting the name like this :...
(this is to manage special patches)

Code: Select all

$toto = self::getCollectionFromDb( "show tables");
$tata =  array_keys($toto['player']);
$titi = explode("_",$tata[0]);
$tablenumber= $titi[4];
but I think there should be something more simple way...
If you have a better solution with a direct variable (that i did not found)... you're welcome.
User avatar
marcgenesis
Posts: 36
Joined: 27 August 2015, 01:53

Re: Get the TABLE number.

Post by marcgenesis »

Hi Rudolf,

Am I right in my understanding that you want the current game's database number? You can do the following in order to do so:

Code: Select all

$dbNumber = current(array_slice( explode("_", self::getUniqueValueFromDB( "SELECT DATABASE();" )), -1, 1 ));
Post Reply

Return to “Developers”