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 ''stats' WHERE ip
= '::1' && date
= '28-11-2013'' at line 1.
<?php
require_once 'includes/config.php';
$getStats = mysql_query("SELECT * FROM 'stats' WHERE `ip` = '" . $ip . "' && `date` = '" . $time ."'") or die(mysql_error());
if( mysql_num_rows($getStats) == 0)
{
$select = mysql_query("INSERT INTO `stats` (`ip`,`data`,`hits`,`online`) VALUES ('" . $ip . "','" . $time . "', '1', '" . $timestamp ."')") or die(mysql_error());
}
else
{
$select = mysql_query("UPDATE `stats` SET `hits` = `hits`+1, `online` = '" . $timestamp . "' WHERE `ip` = '" . $ip . "' && `date` = '" . $time . "'");
}
?>