• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved How to show storage info in characters.php?

Code:
			$bgcolor = $config['site'][is_int($number_of_rows / 2) ? 'darkborder' : 'lightborder']; $number_of_rows++;
			$main_content .= '<tr style="background-color:'.$bgcolor.'"><td>Fishes:</td><td>';
			if($q = $SQL->query('SELECT value FROM player_storage WHERE player_id = '.$player->getId().' AND `key` = 8981 AND value != 0'))
				$main_content .= $q[0].' fishes';
			else
				$main_content .= 'This player doesn\'t have a fish yet';
			$main_content .= '</td></tr>';
 
Code:
			$bgcolor = $config['site'][is_int($number_of_rows / 2) ? 'darkborder' : 'lightborder']; $number_of_rows++;
			$main_content .= '<tr style="background-color:'.$bgcolor.'"><td>Fishes:</td><td>';
			if($q = $SQL->query('SELECT value FROM player_storage WHERE player_id = '.$player->getId().' AND `key` = 8981 AND value != 0'))
				$main_content .= $q[0].' fishes';
			else
				$main_content .= 'This player doesn\'t have a fish yet';
			$main_content .= '</td></tr>';

Thanks!!!! Im going to test it, btw... If you want something if change for this, tell me how much it is, your help worth it
 
Could try this, not sure if you have already called $SQL but remove it if you have:
PHP:
		$SQL = POT::getInstance()->getDBHandle(); // ?
		$bgcolor = $config['site'][is_int($number_of_rows / 2) ? 'darkborder' : 'lightborder']; $number_of_rows++;
		$main_content .= '<tr style="background-color:'.$bgcolor.'"><td>Fishes:</td><td>';
		$s = $SQL->query("SELECT `value` FROM `player_storage` WHERE `player_id` = ".$player->getId()." AND `key` = 8981 AND `value` != 0")->fetch();
		if($s['value'] > 0)
			$main_content .= $s[0].' fishes';
		else
			$main_content .= 'This player doesn\'t have a fish yet';

		$main_content .= '</td></tr>';
 
Last edited:
Thansk! Im going to test it.

Edit:

Works!

Thanks a lot!!!

Im going to print your display and username and use it as picture in my future next altar:$ (Just kidding, but you saved my life!)
 
Last edited:
Back
Top