I'm trying to show on website the current time a player have defeated a monster using by referrence the "value" of a StorageValue.
But when I do the query, page displays only "Array".
I can't number each iten of the list beacause it should be 'endless', as the player would fight the creature so many times as he/she wishes.
Basically, everytime player defeat the X creature, Storage value X receives + 1.
What I want is to display the "value" from this storage.
Waht I have by now is:
When I do the query on a chracter that has never defeated, it returns the right message, but if player has defeated the creature at least 1 time, it returns only "Array".
There's any way to do it, without doing each "if ($wins == 1) .... ?
Thanks in advance!!
But when I do the query, page displays only "Array".
I can't number each iten of the list beacause it should be 'endless', as the player would fight the creature so many times as he/she wishes.
Basically, everytime player defeat the X creature, Storage value X receives + 1.
What I want is to display the "value" from this storage.
Waht I have by now is:
Code:
$wins = $SQL->query("SELECT 'value' FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = '200006'")->fetch();
if ($wins > 0 ) {
echo "$wins";
}
else
{
echo "You haven't defeated this boss yet.";
}
When I do the query on a chracter that has never defeated, it returns the right message, but if player has defeated the creature at least 1 time, it returns only "Array".
There's any way to do it, without doing each "if ($wins == 1) .... ?
Thanks in advance!!
Last edited: