ODER BY problem
Hej...Jeg har et meget mystisk problem... (synes jeg selv)
Jeg har lavet en hits funktion... Og nu skal jeg så ha vist disse hits, med det største først osv....
Men hver gang jeg kommer med et nyt hit placere den sig på toppen af hits..... Se selv på www.cmol.dk/codebase
Koden er som følger:
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://www.cmol.dk/style/style.css">
</head>
<body>
<table width="555" class="liste">
<tr><td align="center" class="underline_bg" colspan="2">
<a href="codelist.php?abc=0-9">0-9</a> -
<a href="codelist.php?abc=A">A</a> -
<a href="codelist.php?abc=B">B</a> -
<a href="codelist.php?abc=C">C</a> -
<a href="codelist.php?abc=D">D</a> -
<a href="codelist.php?abc=E">E</a> -
<a href="codelist.php?abc=F">F</a> -
<a href="codelist.php?abc=G">G</a> -
<a href="codelist.php?abc=H">H</a> -
<a href="codelist.php?abc=I">I</a> -
<a href="codelist.php?abc=J">J</a> -
<a href="codelist.php?abc=K">K</a> -
<a href="codelist.php?abc=L">L</a> -
<a href="codelist.php?abc=M">M</a> -
<a href="codelist.php?abc=N">N</a> -
<a href="codelist.php?abc=O">O</a> -
<a href="codelist.php?abc=P">P</a> -
<a href="codelist.php?abc=Q">Q</a> -
<a href="codelist.php?abc=R">R</a> -
<a href="codelist.php?abc=S">S</a> -
<a href="codelist.php?abc=T">T</a> -
<a href="codelist.php?abc=U">U</a> -
<a href="codelist.php?abc=V">V</a> -
<a href="codelist.php?abc=W">W</a> -
<a href="codelist.php?abc=X">X</a> -
<a href="codelist.php?abc=Y">Y</a> -
<a href="codelist.php?abc=Z">Z</a>
</td></tr>
<tr><td colspan="2">
<br>
<h1>Codebase</h1>
<h2>15 nyeste koder</h2>
<br>
</td></tr>
<?php
include('inc.xxxxxxxxxxx.php');
$query = mysql_query("SELECT id,gamename,date FROM codebase ORDER BY id DESC LIMIT 15") or die(mysql_error());
while ($row = mysql_fetch_assoc($query)) {
echo '<tr>';
echo '<td width="400" class="liste">';
echo '<a href="code.display.php?id='.$row['id'].'">'.$row['gamename'].'</a>';
echo '</td>';
echo '<td class="liste"><p>'.$row['date'].'</p>';
echo '</td>';
echo '</tr>';
}
$query = mysql_query("SELECT id,gamename,hits FROM codebase ORDER BY 'hits' DESC LIMIT 15") or die(mysql_error());
echo '<tr><td colspan="2"><br><br><h2>15 mest brugte</h2><br></td></tr>';
while ($row = mysql_fetch_assoc($query)) {
echo '<tr>';
echo '<td width="400" class="liste">';
echo '<a href="code.display.php?id='.$row['id'].'">'.$row['gamename'].'</a>';
echo '</td>';
echo '<td class="liste"><p>Læst '.$row['hits'].' gange</p>';
echo '</td>';
echo '</tr>';
}
?>
</table>
<p><a href="code.search.php">Søg efter Kode</a> |
<a href="createcode.php">Lav ny kode</a></p>
</body>
</html>
Er jeg helt skør eller hva???
Hygge
Cmol
