When an anonimous user comment, this error is show:

PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '1333490400' for column 'date' at row 1: INSERT INTO {antispam_counter} (date, provider, ham_detected) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 1333490400 [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => 1 ) en antispam_set_counter() (línea 402 de /home/user/sites/all/modules/antispam/antispam.module).

My structure database:

-- phpMyAdmin SQL Dump
-- version 3.4.3.2
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 03-04-2012 a las 22:17:20
-- Versión del servidor: 5.0.92
-- Versión de PHP: 5.2.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Base de datos: `NAME_DATABASE`
--

-- --------------------------------------------------------

--
-- Estructura de tabla para la tabla `PREFIX_antispam_counter`
--

CREATE TABLE IF NOT EXISTS `BLOG_antispam_counter` (
  `id` int(11) NOT NULL auto_increment,
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `provider` int(11) NOT NULL default '0',
  `spam_detected` int(11) default '0',
  `ham_detected` int(11) default '0',
  `false_negative` int(11) default '0',
  `false_positive` int(11) default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=447 ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

Comments

intropedro’s picture

Issue summary: View changes

add structure database information

intropedro’s picture

Status: Active » Closed (fixed)

I have disable the module, after I have uninstall it, then I have enable it and it has worked.

Jason Dean’s picture

Yep same here. I'd just upgraded a D6 site, so I guess a table still had old structure even though update.php had fully run.

Uninstalling and enabling Antispam again fixed it.

Jason Dean’s picture

Issue summary: View changes

Chage path

shinguz’s picture

Status: Closed (fixed) » Needs work

This bug seems to be not fixed any more or re-introduced in AntiSpam 7.x-1.5

I have fixed it like this:

363 function antispam_set_counter($counter_type, $count) { // for today
...
398 // 'date' => strtotime(date('Y-m-d 00:00:00')),
399 'date' => date('Y-m-d'),