Cyrix Posted April 2, 2013 Posted April 2, 2013 Hi, how can i get guild emblem, from Database and show in index page like this: http://gatheringro.ch/ thx.
Hyvraine Posted April 2, 2013 Posted April 2, 2013 (edited) pretty sure it's supposed to be like this: <table> <?php // Connect to database server mysql_connect("127.0.0.1", "ragnarok", "ragnarok") or die (mysql_error ()); // Select database mysql_select_db("ragnarok") or die(mysql_error()); // SQL query $strSQL = "SELECT * from `guild` where `emblem_data` IS NOT NULL"; // Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL); // Loop the recordset $rs while($row = mysql_fetch_array($rs)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo '<td><img src="'.$this->emblem($row['emblem_id']).'"</td>'; echo "</tr>"; } mysql_close(); ?> </table> haven't tried it tho Edited April 2, 2013 by kenshn111 1
-1 Frost Diver Posted September 15, 2019 Posted September 15, 2019 On 4/2/2013 at 9:22 PM, Hyvraine said: pretty sure it's supposed to be like this: haven't tried it tho Where to put this codes?
Hyvraine Posted April 2, 2013 Posted April 2, 2013 <img src="<?php echo $this->emblem($guild->guild_id) ?> $guild->guild_id would be obviously the ID of the guild you want to show
chatterboy Posted April 2, 2013 Posted April 2, 2013 its like this one <img src="<?php echo $this->emblem($guilds[$i]->guild_id) ?>" />
Hyvraine Posted April 2, 2013 Posted April 2, 2013 more like <img src="<?php echo $this->emblem($i) ?>" /> since the code was basically for foreach --
Cyrix Posted April 2, 2013 Author Posted April 2, 2013 (edited) im using: <table> <tr> <td></td> <td><img src="<?php echo $this->emblem($guild->guild_id)$idemb ?>"</td> </center> </tr> <?php // Connect to database server mysql_connect("127.0.0.1", "ragnarok", "ragnarok") or die (mysql_error ()); // Select database mysql_select_db("ragnarok") or die(mysql_error()); // SQL query $strSQL = "SELECT * from `guild` where `emblem_data` IS NOT NULL"; // Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL); $idemb=$row['emblem_id'] // Loop the recordset $rs while($row = mysql_fetch_array($rs)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td></td>"; echo "</tr>"; } echo "</table>"; mysql_close(); ?> but url image = 127.0.0.1/?module=guild&action=emblem&login=FluxRO&charmap=FluxRO&id= Edited April 2, 2013 by Cyrix
Cyrix Posted April 2, 2013 Author Posted April 2, 2013 (edited) pretty sure it's supposed to be like this: <table> <?php // Connect to database server mysql_connect("127.0.0.1", "ragnarok", "ragnarok") or die (mysql_error ()); // Select database mysql_select_db("ragnarok") or die(mysql_error()); // SQL query $strSQL = "SELECT * from `guild` where `emblem_data` IS NOT NULL"; // Execute the query (the recordset $rs contains the result) $rs = mysql_query($strSQL); // Loop the recordset $rs while($row = mysql_fetch_array($rs)) { echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo '<td><img src="'.$this->emblem($row['emblem_id']).'"</td>'; echo "</tr>"; } mysql_close(); ?> </table> haven't tried it tho Thank you... Works fine... (+1) Solved. Edited April 2, 2013 by Cyrix
xairox Posted October 22, 2013 Posted October 22, 2013 as I can do with it, only showing the top guild emblem Number 1??
Question
Cyrix
Hi,
how can i get guild emblem, from Database and show in index page like this: http://gatheringro.ch/
thx.
9 answers to this question
Recommended Posts