Online-brugere
Hejsa,Jeg har et lille problem.
Jeg er ikke særlig god til det med at programmere i PHP så jeg vil spørge om nogen ville være venlig at hjælpe mig
Jeg får hele tiden at vide at der er fejl på linie 20 & 26 - den siger følgene.
Warning: Supplied argument is not a valid MySQL result resource in d:\\home\\webzonedk\\www\\123\\user_online.php on line 20
Warning: Supplied argument is not a valid MySQL result resource in d:\\home\\webzonedk\\www\\123\\user_online.php on line 26
brugere online
Her er hele scriptet :
/*
Downloade hos: www.phpuniverset.dk
*/
<?php
print \'<font face=\"helvetica\" size=\"2\" color=\"#000000\">\';
$mysql_host = \"TEST\";
$mysql_user = \"TEST\";
$mysql_password = \"TEST\";
$ip = $REMOTE_ADDR;
mysql_connect($mysql_host,$mysql_user,$mysql_password);
mysql_select_db(\"webzonedk\");
$time = explode(\" \",microtime());
$array1 = $time[0];
$array2 = $time[1];
$r = mysql_fetch_row( mysql_query(\"SELECT * FROM online_users WHERE ip like \'$ip\'\"));
if ($r == (false)) {
mysql_query(\"INSERT INTO online_users (id,ip,name,date) values (\'\',\'$ip\',\'\',\'$array2\')\");
}
mysql_query(\"DELETE FROM online_users where date < $array2 - 400\");
$res = mysql_query(\"SELECT * FROM online_users\");
$tal = mysql_num_rows($res);
if ($tal == \"1\") {
print \"1 bruger online \";
}
else {
print $tal;
print \" brugere online\";
}
?>
Hjælp mig venligst!
- Thomas
