NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Need help: #1067 - Invalid default value for 'ID'

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-26-2007, 07:51 AM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Jun 2005
Posts: 691
aing has a spectacular aura aboutaing has a spectacular aura about
 



Help! Need help: #1067 - Invalid default value for 'ID'


I have mysql syntax as seen below, and there is problem on it. I'm using mysql 4.1.21-standard version
????: NamePros.com http://www.namepros.com/programming/332211-need-help-1067-invalid-default-value.html


CREATE TABLE alumni (
ID int(11) DEFAULT '0' NOT NULL auto_increment,
First_Name varchar(56) NOT NULL,
Last_Name varchar(128) NOT NULL,
bla...bla...bla...
bla...bla...bla...
bla...bla...bla...
PRIMARY KEY (ID),
KEY ID (ID)
);

and it appears error #1067 - Invalid default value for 'ID'

what should i do? should i change the default value with DEFAULT ''?
but i think the '' value just for text not for integer

anyone could solve this error?
many thanks

aing
__________________
aing is offline  
Old 05-26-2007, 10:07 AM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,557
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
There is no need to specify a default for a ID column. Since it's autonumber the system will always generate a value automatically.
__________________
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
sdsinc is online now  
Old 05-26-2007, 09:40 PM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: Jun 2005
Posts: 691
aing has a spectacular aura aboutaing has a spectacular aura about
 



so, do i have to delete the DEFAULT '0'?
will it affect to result?
i did it and it goes OK, but the script get error maybe it because of my setting
Thanks anyway
__________________
aing is offline  
Old 05-27-2007, 07:06 AM   #4 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,557
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
If you remove DEFAULT '0' you should be OK.
If you still have errors please post the error message.
__________________
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
sdsinc is online now  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 07:11 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger