• 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!

get image from storage [PHP]

_M4G0_

Well-Known Member
Joined
Feb 6, 2016
Messages
504
Solutions
16
Reaction score
98
how can i capture the image according to the value of a storage
1609000545559.png
PHP:
        <?php
            $monster = $db->query('SELECT `value` FROM `global_storage` WHERE `key` = 56404');
        ?>
            <img id="Monster" src="images/monsters/<?php $monster ?>.gif" onClick="window.location = '?subtopic=creatures&creature=<?php echo $config['logo_monster'] ?>';" alt="Monster of the Week" />
            <img id="PedestalAndOnline" src="<?php echo $template_path; ?>/images/header/pedestal-and-online.gif" alt="Monster Pedestal and Players Online Box"/>

Myaac
 
Solution
PHP:
        <?php
            $monster = 'Dragon';
            $query = $db->query('SELECT `value` FROM `global_storage` WHERE `key` = 56404');
            if($query->rowCount() > 0) {
                $query = $query->fetch();
                $monster = $query['value'];
            }
?>
            <img id="Monster" src="images/monsters/<?php $monster ?>.gif" onClick="window.location = '?subtopic=creatures&creature=<?php echo $config['logo_monster'] ?>';" alt="Monster of the Week" />
            <img id="PedestalAndOnline" src="<?php echo $template_path; ?>/images/header/pedestal-and-online.gif" alt="Monster Pedestal and Players Online Box"/>

If it won't find that storage, it will use Dragon by default.
PHP:
        <?php
            $monster = 'Dragon';
            $query = $db->query('SELECT `value` FROM `global_storage` WHERE `key` = 56404');
            if($query->rowCount() > 0) {
                $query = $query->fetch();
                $monster = $query['value'];
            }
?>
            <img id="Monster" src="images/monsters/<?php $monster ?>.gif" onClick="window.location = '?subtopic=creatures&creature=<?php echo $config['logo_monster'] ?>';" alt="Monster of the Week" />
            <img id="PedestalAndOnline" src="<?php echo $template_path; ?>/images/header/pedestal-and-online.gif" alt="Monster Pedestal and Players Online Box"/>

If it won't find that storage, it will use Dragon by default.
 
Solution
Back
Top