Page 1 of 1

Get the TABLE number.

Posted: 25 October 2016, 20:10
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.

Re: Get the TABLE number.

Posted: 26 October 2016, 14:40
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 ));