Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Erro ao exibir dados da database


Brandow

Question

Olha eu estou com um sistema que exibe os resultados da DB de acordo com o numero de votos, mas só que está dando um erros não fica na ordem certa está definido como DESC mais não exibe em ordem decrescente.

<?php
// Connect to our database
require_once('mysql_connect.php');

// Select sites from the database - limit to the top 50 sites
$query = "SELECT * FROM dados_usuarios ORDER BY votes desc limit 10";
$result = mysql_query($query) OR die(mysql_error());

echo '';

// Start the rank counter
$rank = 1;

while ($mostrar = mysql_fetch_array($result, MYSQL_ASSOC)) {
$name = $mostrar['name'];
$url = $mostrar['url'];
$port = $mostrar['port'];
$hits = $mostrar['hits'];
$votes = $mostrar['votes'];
$ID = $mostrar['ID'];
$versao = $mostrar['versao'];
$ip = $mostrar['ip']; 
$pais = $mostrar['pais']; 
$description = $mostrar['description'];
    echo "<div id=contentBox>
      <table width=501 height=26 border=0>
        <tr>
          <td width=17><img src=http://server.blackoutgaming.net:8022/status/?dns=$ip&port=$port&style=1 /></td>
          <td width=214><a href=vote.php?id=$ID target=_blank><img src=http://icons.iconarchive.com/icons/deleket/sleek-xp-basic/16/Add-icon.png border=0><a href=abrir.php?id=$ID target=_blank title=$description>$name</a></td>
          <td width=175><span class=style3>| </span><img src=$pais ><span class=style3> |</span><span class=style2> $versao </span><span class=style3>|</span> <span class=style3>Votos: $votes | </span></td>
          <td width=77><a href=abrir.php?id=$ID target=_blank title=$description><img src=http://yourimg.in/m/065r38c.png border=0  width=75 height=25></a></td>
        </tr>
      </table>
</div>";
    
}
?></center>

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...