top 10 fra mønter
Hvor ligger fejlen? den siger:Hvorfor vil den ikke dette i monter?
den siger:
Warning: mysql_query(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /usr/home/web/web31797/chat/data.php on line 165
Warning: mysql_query(): A link to the server could not be established in /usr/home/web/web31797/chat/data.php on line 165
Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /usr/home/web/web31797/chat/data.php on line 165
Nicis - 0
koden:
<?php
$minutter = 60;
$monter = 10;
$total = mysql_result(mysql_query("SELECT total FROM chatbrugere ORDER BY total DESC LIMIT 10"),0);
$antal_monter = floor(($total/60)/$minutter)*$monter;
?>
<?php
include("db.php");
$res= mysql_query("SELECT * FROM chatbrugere ORDER BY total DESC LIMIT 10");
$row = mysql_fetch_assoc($res);
function sek2tid($s) {
$tim = floor($s/3600);
$tstr = $tim == 1 ? 'time' : 'timer';
$min = ($s/60)%60;
$mstr = $min == 1 ? 'minut' : 'min';
return sprintf("%u %s, %u %s", $tim, $tstr, $min, $mstr);
}
echo "$row[brugernavn] - $antal_monter<br>";
?>
<?php } ?>