Witam, mam taki problem mam taki kod:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<meta name="Author" content="Marek Żukowski" />
<title>Transfery</title>
<style type="text/css">
/* <![CDATA[ */
a:hover {color: #FFFFFF; background-color: #426F0B; style="text-decoration: none"}
/* ]]> */
</style>
</head>
<body link="416F76" vlink="416F76" alink="416F76" bgcolor="A2BE76">
<?php
$polaczenie = mysql_connect("localhost", "mzukowski", "xxx") or
die("Sprawdź połączenie z serwerem");
empty($_GET['sort'])?
$sort='data_s':$sort=$_GET['sort']; $query = 'SELECT * FROM transfery ORDER BY "'.$sort.'"' ;
$transfery = '
<h2><center><br><font face="lucida console">Wszystkie transfery</font><br><br></center></h2>
<table width="90%" border="1" cellpadding="2" cellspacing="2" align="center" bgcolor="FFFFFF">
<tr>
<th><font color="416F76">L.p</font>
<th><a href="transfery.php?sort=imie" style="text-decoration: none">Imię</a></th>
<th><a href="transfery.php?sort=nazwisko" style="text-decoration: none">Nazwisko</a></th>
<th><a href="transfery.php?sort=data_k" style="text-decoration: none">Data kupna</a></th>
<th><a href="transfery.php?sort=cena_k" style="text-decoration: none">Cena</a></th>
<th><a href="transfery.php?sort=data_s" style="text-decoration: none">Data sprzedaży</a></th>
<th><a href="transfery.php?sort=cena_s" style="text-decoration: none">Cena</a></th>
<th><a href="transfery.php?sort=zysk" style="text-decoration: none">zysk/strata</a></th>
</tr>
';
$lp = 0;
$zysk = 0;
$lp++;
$zysk = ($row ['cena_s']) - ($row ['cena_k']);
$transfery .= '
<tr>
<td>'.$lp.'</td>
<td>'.$row['imie'].'</td>
<td>'.$row['nazwisko'].'</td>
<td style="text-align: center;">'.$row['data_k'].'  </td>
<td style="text-align: right;">'.$row['cena_k'].'  </td>
<td style="text-align: center;">'.$row['data_s'].'  </td>
<td style="text-align: right;">'.$row['cena_s'].'  </td>
<td>'.$zysk.'</td>
</tr>
';
}
$transfery .= '</table>';
echo '<h3><center><br><font face="lucida console">Do tej pory przeprowadzono '.$num_transfery.' transferów.</font></center></h3>';
?>
</body>
</html>
Kiedyś było wszystko dobrze a od jakiegoś czasu sortowanie przestało działać :/ nie wiem czemu chodzi mi o te sortowanie po nagłówku tabeli.
Bardzo możliwe że stało się to po wprowadzeniu nowszego phpmyadmina dla mojej bazy na ovh. pewny nie jestem, bo dopiero niedawno zorietnowałem się że nie działa.
Ten post edytował Oscar_83 9.09.2007, 21:44:59