Tento script:
?
<?php
$server_spojeni = @mysql_pconnect("localhost", "root", "");
if (!$server_spojeni) {
$error_mess = "Nepoda?ilo se p?ipojit k datab?zov?mu serveru!";
} else {
$databaze_spojeni = @mysql_select_db("main");
if (!$databaze_spojeni) {
$error_mess = "Nelze naj?t po?adovanou datab?zi!";
} else {
$zaznam[0] = "";
for ($i = 0; $i < 20; $i++) {
if ($zaznam[0] == "") {
$dotaz = 'SELECT MAX(ACCESS) FROM counts';
} else {
$dotaz = 'SELECT MAX(ACCESS) FROM counts WHERE ACCESS < '.$zaznam[0].'';
}
$res = mysql_query($dotaz);
$zaznam = mysql_fetch_array($res);
$dotaz = 'SELECT * FROM counts WHERE ACCESS = '.$zaznam[0].'';
$res = mysql_query($dotaz);
$j = -1;
while ($vysledek = mysql_fetch_array($res)) {
echo $vysledek["ID"]." | ".$vysledek["DAY"]." | ".$vysledek["DAYNAME"]." | ".$vysledek["MONTH"]." | ".$vysledek["YEAR"]." | ".$vysledek["ACCESS"]." | ".$vysledek["SITEWIEV"]."<br>";
$j++;
}
$i = $i - $j;
}
}
}
?>
?
mi vrac? toto:
2 | 24 | 1 | 4 | 2006 | 180 | 516
1 | 23 | 0 | 4 | 2006 | 60 | 227
9 | 1 | 1 | 5 | 2006 | 17 | 188
5 | 27 | 4 | 4 | 2006 | 15 | 204
6 | 28 | 5 | 4 | 2006 | 8 | 112
14 | 4 | 4 | 5 | 2006 | 8 | 54
19 | 21 | 0 | 5 | 2006 | 8 | 118
3 | 25 | 2 | 4 | 2006 | 7 | 28
12 | 2 | 2 | 5 | 2006 | 6 | 195
16 | 6 | 6 | 5 | 2006 | 6 | 54
13 | 3 | 3 | 5 | 2006 | 5 | 42
4 | 26 | 3 | 4 | 2006 | 4 | 43
20 | 23 | 2 | 5 | 2006 | 4 | 45
17 | 7 | 0 | 5 | 2006 | 3 | 44
7 | 29 | 6 | 4 | 2006 | 2 | 7
8 | 30 | 0 | 4 | 2006 | 2 | 11
15 | 5 | 5 | 5 | 2006 | 2 | 260
18 | 8 | 1 | 5 | 2006 | 2 | 47
21 | 31 | 3 | 5 | 2006 | 1 | 5
22 | 2 | 5 | 6 | 2006 | 1 | 3
23 | 18 | 0 | 6 | 2006 | 1 | 18
10 | 1 | 0 | 1 | 2006 | 0 | 1
11 | 1 | 3 | 2 | 2006 | 0 | 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in f:appservwwwtempmax.php on line 30
2 | 24 | 1 | 4 | 2006 | 180 | 516
1 | 23 | 0 | 4 | 2006 | 60 | 227
9 | 1 | 1 | 5 | 2006 | 17 | 188
5 | 27 | 4 | 4 | 2006 | 15 | 204
6 | 28 | 5 | 4 | 2006 | 8 | 112
14 | 4 | 4 | 5 | 2006 | 8 | 54
19 | 21 | 0 | 5 | 2006 | 8 | 118
3 | 25 | 2 | 4 | 2006 | 7 | 28
12 | 2 | 2 | 5 | 2006 | 6 | 195
16 | 6 | 6 | 5 | 2006 | 6 | 54
13 | 3 | 3 | 5 | 2006 | 5 | 42
4 | 26 | 3 | 4 | 2006 | 4 | 43
20 | 23 | 2 | 5 | 2006 | 4 | 45
17 | 7 | 0 | 5 | 2006 | 3 | 44
7 | 29 | 6 | 4 | 2006 | 2 | 7
8 | 30 | 0 | 4 | 2006 | 2 | 11
15 | 5 | 5 | 5 | 2006 | 2 | 260
18 | 8 | 1 | 5 | 2006 | 2 | 47
21 | 31 | 3 | 5 | 2006 | 1 | 5
22 | 2 | 5 | 6 | 2006 | 1 | 3
23 | 18 | 0 | 6 | 2006 | 1 | 18
10 | 1 | 0 | 1 | 2006 | 0 | 1
11 | 1 | 3 | 2 | 2006 | 0 | 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in f:appservwwwtempmax.php on line 30
2 | 24 | 1 | 4 | 2006 | 180 | 516
1 | 23 | 0 | 4 | 2006 | 60 | 227
9 | 1 | 1 | 5 | 2006 | 17 | 188
5 | 27 | 4 | 4 | 2006 | 15 | 204
6 | 28 | 5 | 4 | 2006 | 8 | 112
14 | 4 | 4 | 5 | 2006 | 8 | 54
19 | 21 | 0 | 5 | 2006 | 8 | 118
3 | 25 | 2 | 4 | 2006 | 7 | 28
12 | 2 | 2 | 5 | 2006 | 6 | 195
16 | 6 | 6 | 5 | 2006 | 6 | 54
13 | 3 | 3 | 5 | 2006 | 5 | 42
4 | 26 | 3 | 4 | 2006 | 4 | 43
20 | 23 | 2 | 5 | 2006 | 4 | 45
17 | 7 | 0 | 5 | 2006 | 3 | 44
7 | 29 | 6 | 4 | 2006 | 2 | 7
8 | 30 | 0 | 4 | 2006 | 2 | 11
15 | 5 | 5 | 5 | 2006 | 2 | 260
18 | 8 | 1 | 5 | 2006 | 2 | 47
21 | 31 | 3 | 5 | 2006 | 1 | 5
22 | 2 | 5 | 6 | 2006 | 1 | 3
23 | 18 | 0 | 6 | 2006 | 1 | 18
10 | 1 | 0 | 1 | 2006 | 0 | 1
11 | 1 | 3 | 2 | 2006 | 0 | 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in f:appservwwwtempmax.php on line 30
2 | 24 | 1 | 4 | 2006 | 180 | 516
1 | 23 | 0 | 4 | 2006 | 60 | 227
9 | 1 | 1 | 5 | 2006 | 17 | 188
5 | 27 | 4 | 4 | 2006 | 15 | 204
6 | 28 | 5 | 4 | 2006 | 8 | 112
14 | 4 | 4 | 5 | 2006 | 8 | 54
19 | 21 | 0 | 5 | 2006 | 8 | 118
3 | 25 | 2 | 4 | 2006 | 7 | 28
12 | 2 | 2 | 5 | 2006 | 6 | 195
16 | 6 | 6 | 5 | 2006 | 6 | 54
13 | 3 | 3 | 5 | 2006 | 5 | 42
V tabulce je 23 z?znam?, proto je na ka?d?m 24-t?m ??dku ta chyba.
Jen?e j? pot?ebuju vypsat pouze 20 ??dk? s nejvy??? hodnotou ve sloupci ACCESS. Sloupec ACCESS je ten p?edposledn?.
Jsem v konc?ch, vůbec nev?m, kde je chyba ?:((?
Dok?zal by to n?kdo rozlu?tit?