Fejl på det her script.
Er der en der kan sige mig hvad der er gal med det her den låser sig fast ved gif.3 og gif.3<?php
include("db.php");
$ip = getenv(REMOTE_ADDR);
$tid = date("Y-m-d H:i:s", (time()-600));
mysql_query("DELETE FROM online WHERE tid < '$tid'");
$tjek = mysql_query("SELECT * FROM online WHERE ip='$ip'");
if(mysql_num_rows($tjek) == 0) {
mysql_query("INSERT INTO online (tid, ip) VALUES (now(),'$ip')");
} else {
mysql_query("UPDATE online SET tid=now() WHERE ip='$ip'");
}
$online = mysql_query("SELECT COUNT(*) AS antal FROM online");
$online = ereg_replace("1","<img src='images/1.GIF'>",$online);
$online = ereg_replace("2","<img src='images/2.GIF'>",$online);
$online = ereg_replace("3","<img src='images/3.GIF'>",$online);
echo "$online";
?>
sql
CREATE TABLE `online` (
`id` int(11) NOT NULL auto_increment,
`tid` datetime NOT NULL default '0000-00-00 00:00:00',
`ip` varchar(20) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;CREATE TABLE `online` (
`id` int(11) NOT NULL auto_increment,
`tid` datetime NOT NULL default '0000-00-00 00:00:00',
`ip` varchar(20) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
