OKay, jeg fandt ud af det, men ikke helt... jeg har nu et andet problem, som jeg håber i kan hjælpe med....
Det er fordi at når jeg laver det med at formatere talet, så henter den det samme tal heletiden.
Kig på
http://cmforlife.frac.dk/spillertabel.phpUnder pris er det det samme tal som hele tiden kommer, og det håber jeg i kan hjælpe mig lidt med..
her er koden:
<?php require_once('Connections/db.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_spillere = 25;
$pageNum_spillere = 0;
if (isset($_GET['pageNum_spillere'])) {
$pageNum_spillere = $_GET['pageNum_spillere'];
}
$startRow_spillere = $pageNum_spillere * $maxRows_spillere;
$colname_spillere = "1";
if (isset($_GET['position'])) {
$colname_spillere = (get_magic_quotes_gpc()) ? $_GET['position'] : addslashes($_GET['position']);
}
mysql_select_db($database_db, $db);
$query_spillere = sprintf("SELECT * FROM spiller WHERE idposition LIKE '%%%s%%' ORDER BY oprettelse DESC", $colname_spillere);
$query_limit_spillere = sprintf("%s LIMIT %d, %d", $query_spillere, $startRow_spillere, $maxRows_spillere);
$spillere = mysql_query($query_limit_spillere, $db) or die(mysql_error());
$row_spillere = mysql_fetch_assoc($spillere);
if (isset($_GET['totalRows_spillere'])) {
$totalRows_spillere = $_GET['totalRows_spillere'];
} else {
$all_spillere = mysql_query($query_spillere);
$totalRows_spillere = mysql_num_rows($all_spillere);
}
$totalPages_spillere = ceil($totalRows_spillere/$maxRows_spillere)-1;
$queryString_spillere = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_spillere") == false &&
stristr($param, "totalRows_spillere") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_spillere = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_spillere = sprintf("&totalRows_spillere=%d%s", $totalRows_spillere, $queryString_spillere);
$pris_format = number_format($row_spillere['pris']);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>:: Spillere ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="layout.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {
font-size: 28px;
color: #FFFFFF;
}
.style4 {font-size: 15px}
.style6 {font-size: 24px}
.style7 {font-size: 16px}
.style8 {color: #003366}
.style9 {font-size: 16px; color: #003366; }
-->
</style>
</head>
<body>
<div align="center" class="style2">
<p class="style6">Spillere | <?php echo $_GET['position']; ?></p>
<p class="style4"><a href="spillertabel.php?position=M%E5lmand">Målmand</a> - <a href="spillertabel.php?position=Forsvar">Forsvar</a> - <a href="spillertabel.php?position=Midtbane">Midtbane</a> - <a href="spillertabel.php?position=Angriber">Angriber</a> - <a href="spillertabel.php?position=">Alle</a> - <a href="sogspiller.php">Søg</a> </p>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center">
<?php if ($pageNum_spillere > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, 0, $queryString_spillere); ?>"><img src="First.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center">
<?php if ($pageNum_spillere > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, max(0, $pageNum_spillere - 1), $queryString_spillere); ?>"><img src="Previous.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center">
<?php if ($pageNum_spillere < $totalPages_spillere) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, min($totalPages_spillere, $pageNum_spillere + 1), $queryString_spillere); ?>"><img src="Next.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center">
<?php if ($pageNum_spillere < $totalPages_spillere) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, $totalPages_spillere, $queryString_spillere); ?>"><img src="Last.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<table width="95%" border="1" cellspacing="0" cellpadding="0">
<tr bordercolor="#003366" bgcolor="#FFFFFF">
<th scope="col"><div align="center" class="style7 style8">Navn</div></th>
<th scope="col"><div align="center" class="style9">Alder</div></th>
<th scope="col"><div align="center" class="style9">Nationalitet</div></th>
<th scope="col"><div align="center" class="style9">Klub</div></th>
<th scope="col"><div align="center" class="style9">Position</div></th>
<th scope="col"><div align="center" class="style9">Side</div></th>
<th scope="col"><span class="style9">Pris(DK)</span></th>
</tr>
<?php do { ?>
<tr>
<td><div align="center"><span class="style7"><a href="enspiller.php?ID=<?php echo $row_spillere['ID']; ?>"><?php echo $row_spillere['Navn']; ?></a></span></div></td>
<td><div align="center"><span class="style7"><?php echo $row_spillere['Alder']; ?></span></div></td>
<td><div align="center"><span class="style7"><?php echo $row_spillere['Nationalitet']; ?></span></div></td>
<td><div align="center"><span class="style7"><?php echo $row_spillere['Klub']; ?></span></div></td>
<td><div align="center"><span class="style7"><?php echo $row_spillere['idposition']; ?></span></div></td>
<td><div align="center"><span class="style7"><?php echo $row_spillere['idside']; ?></span></div></td>
<td><div align="center"><span class="style7"><?php echo $pris_format; ?></span></div></td>
</tr>
<?php } while ($row_spillere = mysql_fetch_assoc($spillere)); ?>
<tr bordercolor="#003366" bgcolor="#FFFFFF">
<th scope="col"><div align="center" class="style7 style8">Navn</div></th>
<th scope="col"><div align="center" class="style9">Alder</div></th>
<th scope="col"><div align="center" class="style9">Nationalitet</div></th>
<th scope="col"><div align="center" class="style9">Klub</div></th>
<th scope="col"><div align="center" class="style9">Position</div></th>
<th scope="col"><div align="center" class="style9">Side</div></th>
<th scope="col"><span class="style9">Pris(DK)</span></th>
</tr>
</table>
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center">
<?php if ($pageNum_spillere > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, 0, $queryString_spillere); ?>"><img src="First.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center">
<?php if ($pageNum_spillere > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, max(0, $pageNum_spillere - 1), $queryString_spillere); ?>"><img src="Previous.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center">
<?php if ($pageNum_spillere < $totalPages_spillere) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, min($totalPages_spillere, $pageNum_spillere + 1), $queryString_spillere); ?>"><img src="Next.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center">
<?php if ($pageNum_spillere < $totalPages_spillere) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_spillere=%d%s", $currentPage, $totalPages_spillere, $queryString_spillere); ?>"><img src="Last.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<p><font size="3">Er der ikke nok spillere i databasen?</font></p>
<p><font size="3">Så hjælp os med at få flere.</font></p>
<p><font size="3">Send de gode spillere ind som du kender!</font></p>
<p><font size="3"><a href="spillerformula.htm">Tryk Her</a></font></p>
</div>
</body>
</html>
<?php
mysql_free_result($spillere);
?>