您的SQL語法錯誤;檢查對應於你的MySQL服務器版本正確的語法使用近'統計WHERE ip
=‘:: 1’& & date
= '28手動-11-2013‘’在1號線我收到錯誤SQL
<?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 . "'");
}
?>
這個問題將解決,但會出現另一個問題。這是新問題「字段列表」中的未知列'data' – equals