[authlib]为什么“id int(11)DEFAULT'0'"? [英] [authlib] Why "id int(11) DEFAULT '0'"?

查看:90
本文介绍了[authlib]为什么“id int(11)DEFAULT'0'"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


(很抱歉在PHP中询问这个问题,但我已经在MySQL讨论过

论坛,但没有明确答案):


我正在尝试安装开源iOutliner基于Web的大纲所需的authlib模块( http://ioutliner.com)

但在创建时间中途失败了桌子:


//不好! / * 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上的原始文件:

http://sourceforge.net/project/showf...group_id=20743


当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.

推荐答案

query = mysql_query(" CREATE TABLE authlib_data(

id int(11)DEFAULT''0''NOT NULL auto_increment,

name text NOT NULL,

电子邮件文本NOT NULL,

age int(3)DEFAULT''0''NOT NULL,

性别文本NOT NULL,

school text NOT NULL,

PRIMARY KEY(id)

)");


//坏! / * SQL错误:''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,

用户名文本NOT NULL,

密码文本NOT NULL,

PRIMARY KEY (id)

)");


据谷歌称,DEFAULT''(0)'似乎是一个合法的指令。确实,

如果我删除这部分,它会创建表格。


但是这个错误可以在authlib 1.96中找到

iOutliner和Sourceforge上的原始文件:

http://sourceforge.net/project/showf...group_id=20743


当MySQL是合法的时候它是不合法的以特定方式以
编译?


谢谢。
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.


6月8日,5: 04 pm,Gilles Ganault< nos ... @ nospam.comwrote:
On Jun 8, 5:04 pm, Gilles Ganault <nos...@nospam.comwrote:

Hello


(很抱歉问这个在PHP中,但我已经在MySQL

论坛中提问,但没有明确答案):


我正在尝试安装authlib

所需的模块开源iOutliner基于Web的大纲( http://ioutliner.com)

但在创建表格时中途失败:


//糟糕! / * SQL错误:''id''的默认值无效* /
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'' */


这篇关于[authlib]为什么“id int(11)DEFAULT'0'&quot;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆