זה אמור להיות ככה:
קוד:
$sql = mysql_query("SELECT * FROM statistics WHERE ip='$ip_client'");
$num_rows = mysql_num_rows($sql);
if ($num_rows == 0 ) {
mysql_query("INSERT INTO statistics (ip, date, refer) VALUES ('$ip_client', '$current_date', '$refer')");
}