Reply to [authlib] Why "id int(11) DEFAULT '0'"?

Your name:

Reply:


Posted by Gilles Ganault on 06/08/07 21:04

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/showfiles.php?group_id=20743

Could it be that it's a legal bit when MySQL is compiled in a
particular way?

Thank you.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация