问题描述
您好
(很抱歉在PHP中询问这个问题,但我已经在MySQL讨论过
论坛,但没有明确答案):
我正在尝试安装开源iOutliner基于Web的大纲所需的authlib模块(,
但在创建时间中途失败了桌子:
//不好! / * SQL错误:''id''的默认值无效* /
$ query = mysql_query(" CREATE TABLE authlib_data(
id int(11)DEFAULT' '0''NOT NULL auto_increment,
名称文本NOT NULL,
电子邮件文本NOT NULL,
age int(3)DEFAULT'' 0''NOT NULL,
性别文字NOT NULL,
学校文本NOT NULL,
PRIMARY KEY(id)
)");
//糟糕! / * SQL错误:''id''的默认值无效* /
$ query = mysql_query(" CREATE TABLE authlib_login(
id int(11)DEFAULT' '0''NOT NULL auto_increment,
用户名文本NOT NULL,
密码文本NOT NULL,
PRIMARY KEY(id)
)");
据谷歌称,DEFAULT''(0)'似乎是一个合法的指令。确实,
如果我删除这部分,它会创建表格。
但是这个错误可以在authlib 1.96中找到
iOutliner和Sourceforge上的原始文件:
当MySQL是合法的时候它是不合法的以特定的方式编译成
?
谢谢。
Hello
(Sorry for asking this in a PHP ng, but I already asked in a MySQL
forum, but got no definitive answer):
I''m trying to install the authlib module that''s required for
the open-source iOutliner web-based outliner (http://ioutliner.com),
but it fails halfway through when creating the tables:
//Bad! /* SQL Error: Invalid default value for ''id'' */
$query = mysql_query("CREATE TABLE authlib_data (
id int(11) DEFAULT ''0'' NOT NULL auto_increment,
name text NOT NULL,
email text NOT NULL,
age int(3) DEFAULT ''0'' NOT NULL,
sex text NOT NULL,
school text NOT NULL,
PRIMARY KEY (id)
)");
//Bad! /* SQL Error: Invalid default value for ''id'' */
$query = mysql_query("CREATE TABLE authlib_login (
id int(11) DEFAULT ''0'' NOT NULL auto_increment,
username text NOT NULL,
password text NOT NULL,
PRIMARY KEY (id)
)");
According to Google, DEFAULT ''(0)'' seems a legit instruction. Indeed,
if I remove this part, it creates the table.
But this error is found in both the authlib 1.96 that comes with
iOutliner and the original file on Sourceforge:
http://sourceforge.net/project/showf...group_id=20743
Could it be that it''s a legal bit when MySQL is compiled in a
particular way?
Thank you.
推荐答案
这篇关于[authlib]为什么“id int(11)DEFAULT'0'"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!