Jump to content

Recommended Posts

Hey! I'm making a highscore for a game right now and I need help with the page.

I made the table display what's inside my database - it's a highscore of ranks and stuff like that, displaying the highest level as Rank Number 1. etc...

And I made the Rank number increase automatically for each player in the list.

But at the end of the table, I need to echo the HTML afterwards, but now my footer won't show up on the page :S

 

Could anyone help me?

Here's he code of my page (erased password):

 

<?php

$link = mysql_connect('localhost', 'root', '');
if (!$link) {
	die('Not connected : ' . mysql_error());
}
$db_selected = mysql_select_db('tibiatop', $link);
if (!$db_selected) {
	die('Can\'t use foo : ' . mysql_error());
}
?>

<html> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>Top Exp | Top-Tibia</title> 
<meta name="keywords" content="tibia, top, 1000, 100, 500, best, rank, ranks, ranking, tops, tibiatop, toptibia, levels, magic, axe, club, distance, sword, fighting, fist, fishing, skills, achievements, achievement, point, fansite, tibian, cipsoft" /> 
<meta name="description" content="A highscore board for the MMORPG Tibia, showing the Top 1000 of every skill." /> 
<meta name="robots" content="index, follow" /> 
<meta name="revisit-after" content="1 days" /> 
<meta name="Distribution" content="Global"> 
<meta name="Charset" content="UTF-8"> 
<meta name="Rating" content="General"> 
<meta name="author" content="TopTibia"> 
 
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> 
<link rel="icon" href="favicon.ico" type="image/x-icon"/> 
<script language="javascript" src="js/jquery.js" type="text/javascript"></script>    
<link href="imagens/css.css" rel="stylesheet" type="text/css"> 
<script language="javascript" src="js/jquery.tablesorter.min.js" type="text/javascript"></script> 
<script language="javascript" src="js/jquery.cookie.js" type="text/javascript"></script> 
<script language="javascript" src="js/loads.js" type="text/javascript"></script> 
<!-- GoStats JavaScript Based Code --><script type="text/javascript" src="js/counter.js"></script><script type="text/javascript">_gos='c5.gostats.com';_goa=1035437;_got=5;_goi=1;_gol='simple counter';_GoStatsRun();</script><noscript><a target="_blank" title="simple counter" href="http://gostats.com"><img alt="simple counter" src="http://c5.gostats.com/bin/count/a_1035437/t_5/i_1/counter.png" style="border-width:0" /></a></noscript><!-- End GoStats JavaScript Based Code --> 
</head> 
 
<body> 
 
 
 
<table width="900" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="wrapper"> 
  <tr> 
    <td width="20" rowspan="3" background="imagens/bg_left.gif"> </td> 
    <td height="100%" align="left" valign="top" bgcolor="#FFFFFF"><table width="860" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
        <td width="859" height="110" align="left" valign="middle" background="imagens/bg_topo.gif"><a href="index.html"><img src="imagens/logo.png" alt="FlashList" width="859" height="110" border="0"></a></td> 
        <td width="619" height="110" align="right" valign="bottom"><table width="100%" height="110"  border="0" cellpadding="0" cellspacing="0"> 
          <tr> 
            <td class="table-top"></td> 
          </tr> 
        </table>		</td> 
      </tr> 
      <tr> 
        <td height="43" colspan="2" align="center" valign="bottom" background="imagens/bg_menu.gif"><table width="860" height="36" border="0" cellpadding="0" cellspacing="0"> 
            <tr> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="index.html"><strong>Home</strong></a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/highscores">Highscores</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/forum">Forum</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/downloads">Downloads</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/about">About</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a6373;"><a href="/contact">Contact</a></td> 
            </tr> 
        </table></td> 
      </tr> 
      <tr> 
        <td height="20" colspan="2" background="imagens/bg_sombra_menu.gif"> </td> 
      </tr> 
 
      <tr align="center"> 
        <td colspan="2"><table width="840" border="0" cellspacing="0" cellpadding="0"> 
            <tr> 
              <td width="15" height="38" background="imagens/bg_destaque_topo_left.gif"> </td> 
              <td background="imagens/bg_destaque_topo.gif"><table width="810" border="0" cellspacing="0" cellpadding="0"> 
                  <tr> 
                    <td width="267" align="left" valign="middle"><font size="4" face="Verdana, Geneva, sans-serif"></font></td> 
                    <td width="266" align="left" valign="center" style="border-left: 1px solid #e6e6e6;"><center><font size="4" face="Verdana, Geneva, sans-serif">Latest News</font></center></td> 
                    <td width="277" align="left" valign="middle" style="border-left: 1px solid #e6e6e6;"><font size="4" face="Verdana, Geneva, sans-serif"></font></td> 
                  </tr> 
              </table></td> 
              <td width="15" height="38" background="imagens/bg_destaque_topo_right.gif"> </td> 
            </tr> 
            <tr> 
              <td style="border-left: 1px solid #e6e6e6;"> </td> 
              <td> 
              <table width="810" height="120" border="0" cellpadding="0" cellspacing="0"> 
                  <tr> 
                    <td width="271" align="center" valign="top" style="padding-top: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"><table width="95%"  border="0" cellspacing="0" cellpadding="0" id="destaques"> 
                      <tr> 
                        <td><p>
                        <div align="center"><em><strong>February 28, 2013</strong></em></div>
                        </p>
                        <p>News 1</p></td> 
                      </tr> 
                    </table></td> 
                    <td width="264" align="left" valign="top" style="border-left: 1px solid #e6e6e6; padding-left: 5px; padding-right: 5px; padding-top: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;">
                    	<p><div align="center"><em><strong>February 28, 2013</strong></em></div></p>
                    	<p>News 2</p>
                      
                      </td> 
                    <td width="275" align="left" valign="top" style="border-left: 1px solid #e6e6e6; padding-left: 5px; padding-right: 5px; padding-top: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;">
                    	<p><div align="center"><em><strong>February 28, 2013</strong></em></div></p>
                      <p>News 3</p>
                   
<table width="97%"  border="0" cellspacing="0" cellpadding="0"> 
                      </table></td> 
                  </tr> 
              </table></td> 
              <td style="border-right: 1px solid #e6e6e6;"> </td> 
            </tr> 
            <tr> 
              <td width="11" height="9" background="imagens/bg_destaque_bottom_left.gif" style="font-size: 5px;"> </td> 
              <td style="border-bottom: 1px solid #e6e6e6; font-size: 4px;"><table width="810" height="8" border="0" cellpadding="0" cellspacing="0"> 
                  <tr> 
                    <td width="267" style="font-size: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"> </td> 
                    <td width="266" style="border-left: 1px solid #e6e6e6; font-size: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"> </td> 
                    <td width="277" style="border-left: 1px solid #e6e6e6; font-size: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"> </td> 
                  </tr> 
              </table></td> 
              <td width="11" height="9" background="imagens/bg_destaque_bottom_right.gif" style="font-size: 5px;"> </td> 
            </tr> 
        </table></td> 
      </tr> 
	  
	
       <tr align="center" valign="middle"> 
        <td colspan="2" style="padding-top: 20px; padding-bottom: 10px;"> 
 <div style="border: 1px solid #CCCCCC; padding: 5px; margin-top: 3px;"><marquee width="95%">Welcome to www.Top-Tibia.com! Here you can find the highscores of Tibia.</marquee></div>
      </tr> 
	  
      <tr> 
        <td colspan="2" style="padding: 10px;"> 
        
<style> 
#tooltip{
    position:absolute;
    border:1px solid #CCCCCC;
    background-color: #FFFFFF;
    padding:2px 5px;
    color: #000;
    display:none;
}
.style1 {font-weight: bold}
</style> 
 
<table width="840" border="0" cellspacing="0" cellpadding="0"> 
        <tr> 
          <td width="835" height="32" colspan="3" align="center">
          	<div id="pagina_atual">Top Exp</div>
          	<div id="pagina"><a href="index2.html">Top Magic</a></div>
          	<div id="pagina"><a href="index3.html">Top Achievements</a></div>
          	<div id="pagina"><a href="index4.html">Top Sword</a></div>
          	<div id="pagina"><a href="index5.html">Top Axe</a></div>
          	<div id="pagina"><a href="index6.html">Top Club</a></div>
          	<div id="pagina"><a href="index4.html">Top Shield</a></div>
          	<div id="pagina"><a href="index7.html">Top Distance</a></div>
          	<div id="pagina"><a href="index8.html">Top Fist</a></div>
          	<div id="pagina"><a href="index9.html">Top Fishing</a></div>
		</td> 
        </tr> 
  <tr> 
    <td> 
	<table width="99%" border="0" cellspacing="0" cellpadding="0" style="border-bottom: 1px solid #cccccc;"> 
         <tr> 
          <td width="6" height="32" background="imagens/bg_tabela_titulo_left.gif" style="border-bottom: 1px solid #cccccc; "> </td>
          <td width="30" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b> #</b></td>
          <td width="405" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Name</b></td>
          <td width="290" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Level</b></td>
          <td width="306" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Vocation</b></td>
          <td width="406" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Server</b></td>
          <td width="6" height="32" background="imagens/bg_tabela_titulo_right.gif" style="border-bottom: 1px solid #cccccc; "> </td> 
        </tr> 
            
            <?php
				$result = mysql_query("SELECT rank, name, level, vocation, server FROM topboard ORDER BY level DESC LIMIT 0, 1000");
				$rank = 1;
				
				while ($row = mysql_fetch_array($result, MYSQL_ASSOC) or die(mysql_error())) {
					$player_name = preg_replace("/\s+/", "+", $row['name']);
                
        echo "<tr id='iten-lista_hover'>"; 
        echo "<td style='border-top: 2px solid #FFFFFF; border-left: 1px solid #cccccc;'> </td>"; 
        echo "<td style='border-top: 2px solid #FFFFFF;' align='left'> " . $rank . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['name'] . "(<a href='http://www.tibia.com/community/?subtopic=characters&name=" . $player_name . "' target='_blank'>*</a>)" . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['level'] . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['vocation'] . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['server'] . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF; border-right: 1px solid #cccccc;'> </td>"; 
        echo "</tr>";            
     
     
					$rank++;
				}
				echo "</table>";
				?>
	 
     </td> 
  </tr> 
        <tr> 
          <td height="32" colspan="3" align="center">        
			<div id="proxima"><a href="javascript:scroll(0,0)">Go to top <img src="imagens/proxima.gif" border="0"></a></div>          
		  </td> 
        </tr> 
</table>        
    </table> 

	</td> 
    <td width="20" rowspan="3" align="left" valign="top" background="imagens/bg_right.gif" bgcolor="#FFFFFF"> </td> 
  </tr> 
  
  <tr> 
    <td height="60" align="center" valign="middle" background="imagens/bg_copy.gif" bgcolor="#FFFFFF">
    	<table width="830" height="60"  border="0" cellpadding="0" cellspacing="0"> 
      <tr align="center"> 
        <td valign="middle" width="405" align="left"><strong>Copyright &copy 2013 by www.Top-Tibia.com</strong>.<br> 
Please not that the only official Tibia website is <a href="http://tibia.com" target="_blank">www.tibia.com</a> - Tibia is copyright by <a href="http://cipsoft.com" target="_blank">CipSoft GmbH</a>.</td> 
        <td width="110" align="left" valign="middle"> </td> 
        <td valign="middle" width="515" align="right"><a href="index.html">Home</a> | <a href="/highscores">Highscores</a> | <a href="/forum">Forum</a> |  <a href="/downloads">Downloads</a> | <a href="/about">About</a> | <a href="/contact">Contact</a></td> 
      </tr> 
    </table></td> 
  </tr> 
</table> 
</tr> 
</table>    
 
</body> 
</html>

 

 

The problem is at the lower part of the page, at the php-script. It's something about the echo "</table>";

I have missplaced some of the code, I just can't seem to figure it out :S Any help is appreciated.

 

Here's where the problem occurs:

 

            <?php
				$result = mysql_query("SELECT rank, name, level, vocation, server FROM topboard ORDER BY level DESC LIMIT 0, 1000");
				$rank = 1;
				
				while ($row = mysql_fetch_array($result, MYSQL_ASSOC) or die(mysql_error())) {
					$player_name = preg_replace("/\s+/", "+", $row['name']);
                
        echo "<tr id='iten-lista_hover'>"; 
        echo "<td style='border-top: 2px solid #FFFFFF; border-left: 1px solid #cccccc;'> </td>"; 
        echo "<td style='border-top: 2px solid #FFFFFF;' align='left'> " . $rank . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['name'] . "(<a href='http://www.tibia.com/community/?subtopic=characters&name=" . $player_name . "' target='_blank'>*</a>)" . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['level'] . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['vocation'] . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF;'>" . $row['server'] . "</td>";
        echo "<td style='border-top: 2px solid #FFFFFF; border-right: 1px solid #cccccc;'> </td>"; 
        echo "</tr>";            
     
     
					$rank++;
				}
				echo "</table>";
				?>

And all the way down to the bottom.

 

Here's what my page looks like now:

 

28cen14.png

 

 

 

 

And this is what the bottom of the page should look like - This was before I added the php codes!

This part should be EXACTLY under the table. That "go to top" button appears right under the table without the php-script, but now it just won't work after I added the script :S

 

21bt2j9.jpg

Edited by nemp
Link to comment
https://forums.phpfreaks.com/topic/275070-help-echo-html-footer-of-page/
Share on other sites

Two things:

1) Put this at the top of your page:

error_reporting(E_ALL);
ini_set('display_errors', '1');

 

2) In a browser, view the source code, copy and paste in a codeblock here so we can see what the output is.

 

This is what it says when I view the page source in browsers. It ends after the table :S

 



<html> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title>Top Exp | Top-Tibia</title> 
<meta name="keywords" content="tibia, top, 1000, 100, 500, best, rank, ranks, ranking, tops, tibiatop, toptibia, levels, magic, axe, club, distance, sword, fighting, fist, fishing, skills, achievements, achievement, point, fansite, tibian, cipsoft" /> 
<meta name="description" content="A highscore board for the MMORPG Tibia, showing the Top 1000 of every skill." /> 
<meta name="robots" content="index, follow" /> 
<meta name="revisit-after" content="1 days" /> 
<meta name="Distribution" content="Global"> 
<meta name="Charset" content="UTF-8"> 
<meta name="Rating" content="General"> 
<meta name="author" content="TopTibia"> 
 
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/> 
<link rel="icon" href="favicon.ico" type="image/x-icon"/> 
<script language="javascript" src="js/jquery.js" type="text/javascript"></script>    
<link href="imagens/css.css" rel="stylesheet" type="text/css"> 
<script language="javascript" src="js/jquery.tablesorter.min.js" type="text/javascript"></script> 
<script language="javascript" src="js/jquery.cookie.js" type="text/javascript"></script> 
<script language="javascript" src="js/loads.js" type="text/javascript"></script> 
<!-- GoStats JavaScript Based Code --><script type="text/javascript" src="js/counter.js"></script><script type="text/javascript">_gos='c5.gostats.com';_goa=1035437;_got=5;_goi=1;_gol='simple counter';_GoStatsRun();</script><noscript><a target="_blank" title="simple counter" href="http://gostats.com"><img alt="simple counter" src="http://c5.gostats.com/bin/count/a_1035437/t_5/i_1/counter.png" style="border-width:0" /></a></noscript><!-- End GoStats JavaScript Based Code --> 
</head> 
 
<body> 
 
 
 
<table width="900" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" id="wrapper"> 
  <tr> 
    <td width="20" rowspan="3" background="imagens/bg_left.gif"> </td> 
    <td height="100%" align="left" valign="top" bgcolor="#FFFFFF"><table width="860" border="0" cellspacing="0" cellpadding="0"> 
      <tr> 
        <td width="859" height="110" align="left" valign="middle" background="imagens/bg_topo.gif"><a href="index.html"><img src="imagens/logo.png" alt="FlashList" width="859" height="110" border="0"></a></td> 
        <td width="619" height="110" align="right" valign="bottom"><table width="100%" height="110"  border="0" cellpadding="0" cellspacing="0"> 
          <tr> 
            <td class="table-top"></td> 
          </tr> 
        </table>		</td> 
      </tr> 
      <tr> 
        <td height="43" colspan="2" align="center" valign="bottom" background="imagens/bg_menu.gif"><table width="860" height="36" border="0" cellpadding="0" cellspacing="0"> 
            <tr> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="index.html"><strong>Home</strong></a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/highscores">Highscores</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/forum">Forum</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/downloads">Downloads</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a5962;"><a href="/about">About</a></td> 
              <td align="center" valign="middle" class="menu" style="border-right: 1px solid #4a6373;"><a href="/contact">Contact</a></td> 
            </tr> 
        </table></td> 
      </tr> 
      <tr> 
        <td height="20" colspan="2" background="imagens/bg_sombra_menu.gif"> </td> 
      </tr> 
 
      <tr align="center"> 
        <td colspan="2"><table width="840" border="0" cellspacing="0" cellpadding="0"> 
            <tr> 
              <td width="15" height="38" background="imagens/bg_destaque_topo_left.gif"> </td> 
              <td background="imagens/bg_destaque_topo.gif"><table width="810" border="0" cellspacing="0" cellpadding="0"> 
                  <tr> 
                    <td width="267" align="left" valign="middle"><font size="4" face="Verdana, Geneva, sans-serif"></font></td> 
                    <td width="266" align="left" valign="center" style="border-left: 1px solid #e6e6e6;"><center><font size="4" face="Verdana, Geneva, sans-serif">Latest News</font></center></td> 
                    <td width="277" align="left" valign="middle" style="border-left: 1px solid #e6e6e6;"><font size="4" face="Verdana, Geneva, sans-serif"></font></td> 
                  </tr> 
              </table></td> 
              <td width="15" height="38" background="imagens/bg_destaque_topo_right.gif"> </td> 
            </tr> 
            <tr> 
              <td style="border-left: 1px solid #e6e6e6;"> </td> 
              <td> 
              <table width="810" height="120" border="0" cellpadding="0" cellspacing="0"> 
                  <tr> 
                    <td width="271" align="center" valign="top" style="padding-top: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"><table width="95%"  border="0" cellspacing="0" cellpadding="0" id="destaques"> 
                      <tr> 
                        <td><p>
                        <div align="center"><em><strong>February 28, 2013</strong></em></div>
                        </p>
                        <p>News 1</p></td> 
                      </tr> 
                    </table></td> 
                    <td width="264" align="left" valign="top" style="border-left: 1px solid #e6e6e6; padding-left: 5px; padding-right: 5px; padding-top: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;">
                    	<p><div align="center"><em><strong>February 28, 2013</strong></em></div></p>
                    	<p>News 2</p>
                      
                      </td> 
                    <td width="275" align="left" valign="top" style="border-left: 1px solid #e6e6e6; padding-left: 5px; padding-right: 5px; padding-top: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;">
                    	<p><div align="center"><em><strong>February 28, 2013</strong></em></div></p>
                      <p>News 3</p>
                   
<table width="97%"  border="0" cellspacing="0" cellpadding="0"> 
                      </table></td> 
                  </tr> 
              </table></td> 
              <td style="border-right: 1px solid #e6e6e6;"> </td> 
            </tr> 
            <tr> 
              <td width="11" height="9" background="imagens/bg_destaque_bottom_left.gif" style="font-size: 5px;"> </td> 
              <td style="border-bottom: 1px solid #e6e6e6; font-size: 4px;"><table width="810" height="8" border="0" cellpadding="0" cellspacing="0"> 
                  <tr> 
                    <td width="267" style="font-size: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"> </td> 
                    <td width="266" style="border-left: 1px solid #e6e6e6; font-size: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"> </td> 
                    <td width="277" style="border-left: 1px solid #e6e6e6; font-size: 5px; background: url(imagens/bg_barra_destaque.jpg) repeat-y;"> </td> 
                  </tr> 
              </table></td> 
              <td width="11" height="9" background="imagens/bg_destaque_bottom_right.gif" style="font-size: 5px;"> </td> 
            </tr> 
        </table></td> 
      </tr> 
	  
	
       <tr align="center" valign="middle"> 
        <td colspan="2" style="padding-top: 20px; padding-bottom: 10px;"> 
 <div style="border: 1px solid #CCCCCC; padding: 5px; margin-top: 3px;"><marquee width="95%">Welcome to www.Top-Tibia.com! Here you can find the highscores of Tibia.</marquee></div>
      </tr> 
	  
      <tr> 
        <td colspan="2" style="padding: 10px;"> 
        
<style> 
#tooltip{
    position:absolute;
    border:1px solid #CCCCCC;
    background-color: #FFFFFF;
    padding:2px 5px;
    color: #000;
    display:none;
}
.style1 {font-weight: bold}
</style> 
 
<table width="840" border="0" cellspacing="0" cellpadding="0"> 
        <tr> 
          <td width="835" height="32" colspan="3" align="center">
          	<div id="pagina_atual">Top Exp</div>
          	<div id="pagina"><a href="index2.html">Top Magic</a></div>
          	<div id="pagina"><a href="index3.html">Top Achievements</a></div>
          	<div id="pagina"><a href="index4.html">Top Sword</a></div>
          	<div id="pagina"><a href="index5.html">Top Axe</a></div>
          	<div id="pagina"><a href="index6.html">Top Club</a></div>
          	<div id="pagina"><a href="index4.html">Top Shield</a></div>
          	<div id="pagina"><a href="index7.html">Top Distance</a></div>
          	<div id="pagina"><a href="index8.html">Top Fist</a></div>
          	<div id="pagina"><a href="index9.html">Top Fishing</a></div>
		</td> 
        </tr> 
  <tr> 
    <td> 
	<table width="99%" border="0" cellspacing="0" cellpadding="0" style="border-bottom: 1px solid #cccccc;"> 
         <tr> 
          <td width="6" height="32" background="imagens/bg_tabela_titulo_left.gif" style="border-bottom: 1px solid #cccccc; "> </td>
          <td width="30" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b> #</b></td>
          <td width="405" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Name</b></td>
          <td width="290" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Level</b></td>
          <td width="306" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Vocation</b></td>
          <td width="406" height="32" align="left" valign="middle" background="imagens/bg_tabela_titulo.gif" style="border-bottom: 1px solid #cccccc; "><b>Server</b></td>
          <td width="6" height="32" background="imagens/bg_tabela_titulo_right.gif" style="border-bottom: 1px solid #cccccc; "> </td> 
        </tr> 
            
            <tr id='iten-lista_hover'><td style='border-top: 2px solid #FFFFFF; border-left: 1px solid #cccccc;'> </td><td style='border-top: 2px solid #FFFFFF;' align='left'> 1</td><td style='border-top: 2px solid #FFFFFF;'>Name Three(<a href='http://www.tibia.com/community/?subtopic=characters&name=Name+Three' target='_blank'>*</a>)</td><td style='border-top: 2px solid #FFFFFF;'>300</td><td style='border-top: 2px solid #FFFFFF;'>Knight</td><td style='border-top: 2px solid #FFFFFF;'>Secura</td><td style='border-top: 2px solid #FFFFFF; border-right: 1px solid #cccccc;'> </td></tr><tr id='iten-lista_hover'><td style='border-top: 2px solid #FFFFFF; border-left: 1px solid #cccccc;'> </td><td style='border-top: 2px solid #FFFFFF;' align='left'> 2</td><td style='border-top: 2px solid #FFFFFF;'>Name Two(<a href='http://www.tibia.com/community/?subtopic=characters&name=Name+Two' target='_blank'>*</a>)</td><td style='border-top: 2px solid #FFFFFF;'>250</td><td style='border-top: 2px solid #FFFFFF;'>Sorcerer</td><td style='border-top: 2px solid #FFFFFF;'>Harmonia</td><td style='border-top: 2px solid #FFFFFF; border-right: 1px solid #cccccc;'> </td></tr><tr id='iten-lista_hover'><td style='border-top: 2px solid #FFFFFF; border-left: 1px solid #cccccc;'> </td><td style='border-top: 2px solid #FFFFFF;' align='left'> 3</td><td style='border-top: 2px solid #FFFFFF;'>Name One(<a href='http://www.tibia.com/community/?subtopic=characters&name=Name+One' target='_blank'>*</a>)</td><td style='border-top: 2px solid #FFFFFF;'>100</td><td style='border-top: 2px solid #FFFFFF;'>Druid</td><td style='border-top: 2px solid #FFFFFF;'>Antica</td><td style='border-top: 2px solid #FFFFFF; border-right: 1px solid #cccccc;'> </td></tr><tr id='iten-lista_hover'><td style='border-top: 2px solid #FFFFFF; border-left: 1px solid #cccccc;'> </td><td style='border-top: 2px solid #FFFFFF;' align='left'> 4</td><td style='border-top: 2px solid #FFFFFF;'>Name Five(<a href='http://www.tibia.com/community/?subtopic=characters&name=Name+Five' target='_blank'>*</a>)</td><td style='border-top: 2px solid #FFFFFF;'>14</td><td style='border-top: 2px solid #FFFFFF;'>Elder Druid</td><td style='border-top: 2px solid #FFFFFF;'>Titania</td><td style='border-top: 2px solid #FFFFFF; border-right: 1px solid #cccccc;'> </td></tr><tr id='iten-lista_hover'><td style='border-top: 2px solid #FFFFFF; border-left: 1px solid #cccccc;'> </td><td style='border-top: 2px solid #FFFFFF;' align='left'> 5</td><td style='border-top: 2px solid #FFFFFF;'>Name Four(<a href='http://www.tibia.com/community/?subtopic=characters&name=Name+Four' target='_blank'>*</a>)</td><td style='border-top: 2px solid #FFFFFF;'>9</td><td style='border-top: 2px solid #FFFFFF;'>Paladin</td><td style='border-top: 2px solid #FFFFFF;'>Olympa</td><td style='border-top: 2px solid #FFFFFF; border-right: 1px solid #cccccc;'> </td></tr>

I set up a basic database and simulated your setup.

 

Change your while to this:

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

 

having


while ($row = mysql_fetch_array($result, MYSQL_ASSOC) or die(mysql_error())) { 

 

will always die when the resource runs out. Only use or die(mysql_error()) on an actual query.

I set up a basic database and simulated your setup.

 

Change your while to this:

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

 

having

while ($row = mysql_fetch_array($result, MYSQL_ASSOC) or die(mysql_error())) { 

 

will always die when the resource runs out. Only use or die(mysql_error()) on an actual query.

 

I'm an atheist.... but man, you're a GOD!!!

 

Thank you so so much!!! I was going crazy cus of this problem. I tried fix it for hours. Thank you!!! :D

This will not work as expected!


while ($row = mysql_fetch_array($result, MYSQL_ASSOC) or die(mysql_error())) { 
You need to check if $result is false before attempting to use it with mysql_fetch_array. Also, after the final row has been consume, mysql_fetch_array will return false and thus trigger the or die () part.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.