0

Background:

Apache2: 2.4.18 PHP: 7.0.1X Software: PHPMelody

Issue:

I am getting an error output on the sql execution of:

ERROR 1067 (42000) at line 150: Invalid default value for 'date'

Code at line 150:

DROP TABLE IF EXISTS pm_ads_log; CREATE TABLE pm_ads_log ( log_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, date date NOT NULL DEFAULT '0000-00-00', ad_id mediumint(6) NOT NULL DEFAULT '0', ad_type smallint(2) NOT NULL DEFAULT '0', impressions int(11) unsigned NOT NULL DEFAULT '0', clicks int(11) unsigned NOT NULL DEFAULT '0', skips int(11) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (log_id), UNIQUE KEY date (date,ad_id,ad_type) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Im not a php developer or sql db, but right now Im having to deal with both very briefly.

Can anyone provide any guidance to help me get past this?

Fallenour
  • 62
  • 1
  • 10

1 Answers1

2

You've already specified that it should not be null so it won't be blank.

Try removing DEFAULT '0000-00-00' as it is the default format anyway.

Leah
  • 336
  • 4
  • 14
  • I tried removing '0000-00-00' I tried changing it to '0' and '00-00-0000' Each instance gave me a similar error, or stated: invalid value for date – Fallenour Oct 25 '17 at 11:26
  • @Fallenour Try removing the word `DEFAULT` too – Leah Oct 25 '17 at 11:26