Zezicla Posted March 27, 2014 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 121 Reputation: 1 Joined: 12/01/12 Last Seen: May 9, 2015 Share Posted March 27, 2014 i got this somewhere i cant seem to get this working <?php if (!defined('FLUX_ROOT')) exit; $query = "SELECT name, master FROM {$session->loginAthenaGroup->loginDatabase}.guild WHERE guild_id = ? "; $sth = $session->loginAthenaGroup->connection->getStatement($query); $sth->execute(array($gtheme_config['guild_id'])); $gtheme_gom = $sth->fetchAll(); ?> <ul id="pgom"> <?php if($gtheme_gom): ?> <?php foreach($gtheme_gom as $row): ?> <li> <img class="gom" src="<?php echo $this->emblem($row->guild_id) ?>" /> </li> <li id="lbl" ><b>Guild: </b> <?php echo ($row->name)?$row->name:'???' ?></li> <li id="lbl" ><b>GM: </b> <?php echo ($row->master)? $row->master:'???' ?></li> <?php endforeach; ?> Link to comment Share on other sites More sharing options...
prokopio Posted March 28, 2014 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 29 Reputation: 1 Joined: 03/27/14 Last Seen: July 12, 2020 Share Posted March 28, 2014 what seems to be the error on this line? can you post it here please? Link to comment Share on other sites More sharing options...
Zezicla Posted March 28, 2014 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 121 Reputation: 1 Joined: 12/01/12 Last Seen: May 9, 2015 Author Share Posted March 28, 2014 i think the error is in this lines <li id="lbl" ><b>Guild: </b> <?php echo ($row->name)?$row->name:'???' ?></li> <li id="lbl" ><b>GM: </b> <?php echo ($row->master)? $row->master:'???' ?></li> but ive some1 who knows this shit can look at it Link to comment Share on other sites More sharing options...
Emistry Posted March 28, 2014 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 18 hours ago Share Posted March 28, 2014 $query = "SELECT name, master FROM {$session->loginAthenaGroup->loginDatabase}.guild WHERE guild_id = ? "; hmm ?? guild_id = ? pick entry based on "unknown" guild_id ?? make sure you bind it / declared it somewhere... before you fetch all the data. Link to comment Share on other sites More sharing options...
Zezicla Posted March 28, 2014 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 121 Reputation: 1 Joined: 12/01/12 Last Seen: May 9, 2015 Author Share Posted March 28, 2014 so how to fix that ? Link to comment Share on other sites More sharing options...
prokopio Posted March 28, 2014 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 29 Reputation: 1 Joined: 03/27/14 Last Seen: July 12, 2020 Share Posted March 28, 2014 what error does it shows exactly when you run that code?if it doesnt and only an empty query..hince, there's no data fetched by that query... Link to comment Share on other sites More sharing options...
Zezicla Posted March 29, 2014 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 121 Reputation: 1 Joined: 12/01/12 Last Seen: May 9, 2015 Author Share Posted March 29, 2014 no error i just doesnt shows Link to comment Share on other sites More sharing options...
prokopio Posted March 29, 2014 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 29 Reputation: 1 Joined: 03/27/14 Last Seen: July 12, 2020 Share Posted March 29, 2014 (edited) so if that's the case,the table guild doesnt have any data yet...so there's nothing to fetch... Edited March 29, 2014 by prokopio Link to comment Share on other sites More sharing options...
Aries Posted May 4, 2014 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 70 Reputation: 18 Joined: 01/28/12 Last Seen: May 10, 2021 Share Posted May 4, 2014 (edited) $sth->execute(array($gtheme_config['guild_id'])); where do you get the $gtheme_config['guild_id']? The code seem to work though. Notice that I added a guild id there which I cannot see on your code. <?php if (! defined('FLUX_ROOT')) exit; $guild_id = 1; // <- guild id $sql = "SELECT name, master FROM {$server->charMapDatabase}.guild WHERE guild_id = ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array($guild_id)); $gtheme_gom = $sth->fetch(); // just use fetch since you only expect one result unless .. ?> <ul id="pgom"> <li> <img class="gom" src="<?php echo $this->emblem($guild_id); ?>" /> </li> <li id="lbl" ><b>Guild: </b> <?php echo $gtheme_gom ? $gtheme_gom->name : '???'; ?></li> <li id="lbl" ><b>GM: </b> <?php echo $gtheme_gom ? $gtheme_gom->master : '???'; ?></li> </ul> Edited May 4, 2014 by Choko Designoper Link to comment Share on other sites More sharing options...
Question
Zezicla
i got this somewhere i cant seem to get this working
Link to comment
Share on other sites
8 answers to this question
Recommended Posts