帮我上传资料库

编程入门 行业动态 更新时间:2024-10-19 14:41:22
本文介绍了帮我上传资料库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在数据库中创建一个表,但是出现错误 我的代码有什么问题 代码

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) );

错误 #1067-''aid'' 的默认值无效 :confused :: confused:

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-''aid'' 的默认值无效 您能帮我吗?

#1067 - Invalid default value for ''aid'' Can you help me

推荐答案

我建​​议购买一本有关SQL的基本书.引号中的任何内容都是字符串.您的int类型应该具有默认值0,而不是"0" I suggest buying a basic book on SQL. Anything in quotes is a string. Your int type should have a default value of 0, not ''0''

我已将"0"更改为0,但仍然存在相同的错误 您能提供更多我还在学习的细节吗? :confused :: confused::doh: I''ve changed ''0 '' to 0 but still the same error Can you provide more detail I am still learning :confused::confused: :doh:

int不允许大小. 因此您不应该指定int(11). int doesnt allow size. so you shouldnt be specifying int(11). CREATE TABLE ad_banners( aid int DEFAULT '0' NOT NULL ...

这是您指定的... ; P

This is what you specify... ;P

更多推荐

帮我上传资料库

本文发布于:2023-10-24 14:09:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524142.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:帮我   资料库   上传

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!