I want to create a table in the data base but the error
what's wrong with my code
code
CREATE TABLE ad_banners (
aid int(11) DEFAULT '0' NOT NULL auto_increment,
name tinytext,
description tinytext,
size varchar(7),
file_type varchar(4),
status varchar(1),
date datetime,
url tinytext,
PRIMARY KEY (aid)
);
CREATE TABLE ad_errors (
date datetime,
cid int(11),
aid int(11),
pid int(11),
http_referer tinytext,
remote_addr varchar(15),
http_user_agent tinytext,
error text,
request_uri tinytext
);
CREATE TABLE ad_groups (
gid char(16) DEFAULT '' NOT NULL,
aid int(11) DEFAULT '0' NOT NULL,
date int(11),
nweight_lb double(6,4),
nweight_ub double(6,4),
KEY gid (gid)
);
CREATE TABLE ad_partners (
pid int(11) DEFAULT '0' NOT NULL auto_increment,
status char(16),
gid char(16),
expire_date int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (pid)
);
CREATE TABLE ad_summary (
pid int(11) DEFAULT '0' NOT NULL,
aid int(11) DEFAULT '0' NOT NULL,
date int(11) DEFAULT '0' NOT NULL,
date_year int(6) DEFAULT '0' NOT NULL,
date_month tinyint(4) DEFAULT '0' NOT NULL,
date_mday tinyint(4) DEFAULT '0' NOT NULL,
date_wday tinyint(4) DEFAULT '0' NOT NULL,
date_hour tinyint(4) DEFAULT '0' NOT NULL,
hits int(11),
clicks int(11),
mid tinyint(4),
KEY pid (pid),
KEY aid (aid),
KEY date (date)
);
CREATE TABLE clients_1 (
cid int(11) DEFAULT '0' NOT NULL auto_increment,
remote_addr varchar(15) DEFAULT '' NOT NULL,
http_user_agent tinytext,
mid tinyint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (cid)
);
CREATE TABLE hits_1 (
cid int(11) DEFAULT '0' NOT NULL,
sid int(11) DEFAULT '0' NOT NULL,
pid int(11) DEFAULT '0' NOT NULL,
aid int(11) DEFAULT '0' NOT NULL,
date int(11),
remote_addr varchar(15) DEFAULT '' NOT NULL,
http_referer_host tinytext,
http_referer_query tinytext,
http_user_agent tinytext,
mid tinyint(4) DEFAULT '0' NOT NULL
);
CREATE TABLE tracking_sites (
sid int(11) DEFAULT '0' NOT NULL auto_increment,
name tinytext,
PRIMARY KEY (sid)
);
CREATE TABLE tracking_summary (
sid int(11) DEFAULT '0' NOT NULL,
date int(11) DEFAULT '0' NOT NULL,
date_year int(6) DEFAULT '0' NOT NULL,
date_month tinyint(4) DEFAULT '0' NOT NULL,
date_mday tinyint(4) DEFAULT '0' NOT NULL,
date_wday tinyint(4) DEFAULT '0' NOT NULL,
date_hour tinyint(4) DEFAULT '0' NOT NULL,
hits int(11),
clicks int(11),
mid tinyint(4) DEFAULT '0',
KEY sid (sid),
KEY date (date)
);
Error
#1067 - Invalid default value for
'aid'
:confused::confused:
CREATE TABLE ad_banners(
aid int( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT ,
name tinytext,
description tinytext,
size varchar( 7 ) ,
file_type varchar( 4 ) ,
STATUS varchar( 1 ) ,
date datetime,
url tinytext,
PRIMARY KEY ( aid )
);
#1067 - Invalid default value for
'aid'
Can you help me