Cytat
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' urls='' ,AND time>='1264460400' AND time<='1264546799'' at line 1
$tpl->set_var('link_time','5'); $tpl->set_var('link_head','http://'.$link_head); $user = $_GET['user']; $type = $_GET['type']; $ip = $_SERVER['REMOTE_ADDR']; $urls = $_SERVER['HTTP_REFERER'] ; $mysql->query("SELECT id FROM stats WHERE ip='$ip', urls='$urls' ,AND time>='$from' AND time<='$to'",'a'); if ( $mysql->num('a') == 0 ) { $mysql->query("INSERT INTO stats ( `id`, `id_user`, `type`, `ip` , `urls` ,`time` ) VALUES ( '','$user','$type','$ip','$urls','$time')",'add'); }