interspire09 Posted August 1, 2009 Share Posted August 1, 2009 Hello all, I have a script that uses mysql and am having trouble inserting two tables into my database. copies of the code are below... pleaseee tell me what im doing wrong.... THANK YOU FOR YOUR HELP.. ERROR 1: Error SQL query: # Create table structure for 'tmpmember' table CREATE TABLE tmpmember( tmpmemberID int( 11 ) NOT NULL AUTO_INCREMENT , title varchar( 80 ) NOT NULL default '', firstname varchar( 80 ) NOT NULL default '', lastname varchar( 80 ) NOT NULL default '', email varchar( 80 ) NOT NULL default '', address varchar( 80 ) NOT NULL default '', suburb varchar( 80 ) NOT NULL default '', state varchar( 80 ) NOT NULL default '', country varchar( 80 ) NOT NULL default '', postcode varchar( 11 ) NOT NULL default '', mobile varchar( 80 ) NOT NULL default '', phone varchar( 80 ) NOT NULL default '', fax varchar( 80 ) NOT NULL default '', username varchar( 15 ) NOT NULL default '', PASSWORD varchar( 15 ) NOT NULL default '', membership int( 2 ) NOT NULL default '', payment int( 2 ) NOT NULL default '', creation_date bigint( 14 ) NOT NULL , PRIMARY KEY ( tmpmemberID ) , UNIQUE ( tmpmemberID ) ) TYPE = MYISAM ; MySQL said: Documentation #1067 - Invalid default value for 'membership' SECOND TABLE WITH ERROR: Error SQL query: # Create table structure for 'member' table CREATE TABLE member( memberID int( 11 ) NOT NULL AUTO_INCREMENT , title varchar( 80 ) NOT NULL default '', firstname varchar( 80 ) NOT NULL default '', lastname varchar( 80 ) NOT NULL default '', email varchar( 80 ) NOT NULL default '', address varchar( 80 ) NOT NULL default '', suburb varchar( 80 ) NOT NULL default '', state varchar( 80 ) NOT NULL default '', country varchar( 80 ) NOT NULL default '', postcode varchar( 11 ) NOT NULL default '', mobile varchar( 80 ) NOT NULL default '', phone varchar( 80 ) NOT NULL default '', fax varchar( 80 ) NOT NULL default '', membership int( 2 ) NOT NULL default '', payment int( 2 ) NOT NULL default '', startdate bigint( 14 ) NOT NULL default 0, enddate bigint( 14 ) NOT NULL default 0, userID int( 11 ) NOT NULL , PRIMARY KEY ( memberID ) , UNIQUE ( memberID ) ) TYPE = MYISAM ; MySQL said: Documentation #1067 - Invalid default value for 'membership' I am using the following on my box CENTOS 5.3 i686 standard PHP version 4.4.9 MySQL version 5.0.77-community Quote Link to comment https://forums.phpfreaks.com/topic/168355-solved-problems-with-two-tables-1067-invalid-default-value-for/ Share on other sites More sharing options...
gassaz Posted August 1, 2009 Share Posted August 1, 2009 Change the default value of INT type to 0. Quote Link to comment https://forums.phpfreaks.com/topic/168355-solved-problems-with-two-tables-1067-invalid-default-value-for/#findComment-888367 Share on other sites More sharing options...
interspire09 Posted August 1, 2009 Author Share Posted August 1, 2009 Thank you I ended up fixing it works well!!!! Quote Link to comment https://forums.phpfreaks.com/topic/168355-solved-problems-with-two-tables-1067-invalid-default-value-for/#findComment-888555 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.