eaglelegend Posted March 1, 2009 Share Posted March 1, 2009 Hey guys, I am having this sql problem as you will see below, and I was wondering if you guys could help me spot what the issiue is - many thanks in advance! Error SQL query: # MySQL dump 7.1 # # Host: localhost Database: el_labs #-------------------------------------------------------- # Server version 3.22.32 # # Table structure for table 'colors' # CREATE TABLE colors( id int( 11 ) DEFAULT '0' NOT NULL AUTO_INCREMENT , hex varchar( 6 ) DEFAULT 'dddddd' NOT NULL , label varchar( 20 ) DEFAULT 'Medium Gray' NOT NULL , PRIMARY KEY ( id ) ); MySQL said: Documentation #1067 - Invalid default value for 'id' Quote Link to comment https://forums.phpfreaks.com/topic/147420-solved-sql-error/ Share on other sites More sharing options...
Mchl Posted March 1, 2009 Share Posted March 1, 2009 Try: CREATE TABLE colors( id int( 11 ) NOT NULL AUTO_INCREMENT , hex varchar( 6 ) DEFAULT 'dddddd' NOT NULL , label varchar( 20 ) DEFAULT 'Medium Gray' NOT NULL , PRIMARY KEY ( id ) ); you can't have default value for AUTO_INCREMENT since it is... autoincremented on each insert. Quote Link to comment https://forums.phpfreaks.com/topic/147420-solved-sql-error/#findComment-773787 Share on other sites More sharing options...
eaglelegend Posted March 1, 2009 Author Share Posted March 1, 2009 Thanks mate, thats helped me alot Quote Link to comment https://forums.phpfreaks.com/topic/147420-solved-sql-error/#findComment-773942 Share on other sites More sharing options...
Mchl Posted March 1, 2009 Share Posted March 1, 2009 # Server version 3.22.32 That's very old version... I hope you're moving to something more up to date Quote Link to comment https://forums.phpfreaks.com/topic/147420-solved-sql-error/#findComment-773962 Share on other sites More sharing options...
eaglelegend Posted March 1, 2009 Author Share Posted March 1, 2009 LOL my real server version is LOL, that particular script last update from the actual developer was 2000 - 9 years ago, although looking at where I got it from, 9 years later one of the developers say they are going to update it LOL - well I am going to try and update the script myself, along with many other scripts - however I am testing them all in a very secured area - knowing that scripts that old could be a big security risk! Quote Link to comment https://forums.phpfreaks.com/topic/147420-solved-sql-error/#findComment-773985 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.