I'm struggling with a value just updated in DB.
I need this value as an argument in the State CombatChoices.
PHP
Code: Select all
$sql = "UPDATE token SET token_specialpower_counter='-10' WHERE token_id='".$part_token['id']."
self::DbQuery( $sql );
$twoHandedSword ++;
if( $twoHandedSword > 0 ){
$this->gamestate->nextState( 'combatchoices' );
function argCombatChoices() {
$token = self::getObjectListFromDb( "SELECT token_id id, token_type type FROM token WHERE token_specialpower_counter ='-10' ");
$nb_tokens = count($token);
$token_type = $token[0]['type'];
return array(
'nb_tokens' => $nb_tokens,
'token_type' => $token_type
);and it's working perfectly when hitting F5...
Can someone explain to me what is happening here ?