Wayniac Posted March 24, 2010 Share Posted March 24, 2010 Any idea on what part of my syntax could be causing this issue? CREATE TABLE `spreadsheet` ( `spreadsheetid` int( 11 ) NOT NULL auto_increment, `date` varchar default NOT NULL , `invoice_num` int( 35 ) NOT NULL , `conf_num` int( 35 ) NOT NULL , `fname` text, `lname` text, `bill_add` varchar default NULL , `bill_city` varchar default NULL , `bill_zip` varchar default NULL , `bill_state` text, `bill_country` text, `ship_add` varchar default NULL , `ship_city` varchar default NULL , `ship_zip` varchar default NULL , `ship_state` text, `ship_country` text, `terms` varchar default NULL , `item_num` int( 35 ) NOT NULL , `desc` varchar default NULL , `quantity` int( 11 ) NOT NULL , `price` varchar default NULL , `amount` varchar default NULL , `sh` varchar default NULL , `total` varchar default NULL , `ccard` varchar default NULL , `color` int( 3 ) NOT NULL , `label` varchar default NULL , `email` varchar default NULL , `phone` varchar default NULL , `order_date` varchar default NULL , `inv_total` int( 11 ) NOT NULL , `inv_minus_sales` int( 11 ) NOT NULL , `trees_sold` int( 11 ) NOT NULL , `trees_gifted` int( 11 ) NOT NULL , `trees_comp` int( 11 ) NOT NULL , `unit_cost` varchar default NULL , `sub_total` varchar default NULL , `tax` varchar default NULL , `total_paid` varchar default NULL , `payment_method` text, `notes` varchar default NULL , `date_sent` varchar default NULL , `attn` varchar default NULL , `seedlings` int( 11 ) NOT NULL , `four_four` varchar default NULL , `hear_about` varchar default NULL , `order_emp` varchar default NULL , `comm_fname` text, `comm_lname` text, `comm_total` varchar default NULL , `comm_date_paid` varchar default NULL , PRIMARY KEY ( `spreadsheetid` ) )ENGINE = MYISAM AUTO_INCREMENT = 62DEFAULTCHARSET = latin1 MySQL said: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default not NULL, `invoice_num` int(35) NOT NULL, `conf_num` int(35) NOT N' at line 3 Quote Link to comment https://forums.phpfreaks.com/topic/196345-mysql-error-report/ Share on other sites More sharing options...
Wayniac Posted March 24, 2010 Author Share Posted March 24, 2010 Okay, so I removed the defaults because they were not being used for anything, but am still having an issue with the NOT NULL.... My server is: MySQL 5.0.77-log running on MySQL Server Farm 2 Quote Link to comment https://forums.phpfreaks.com/topic/196345-mysql-error-report/#findComment-1031126 Share on other sites More sharing options...
Wayniac Posted March 24, 2010 Author Share Posted March 24, 2010 Well, after a while of playing with it, I got it working. I'll post the working copy below. DROP TABLE IF EXISTS `spreadsheet`; CREATE TABLE `spreadsheet` ( `spreadsheetid` int(11) NOT NULL auto_increment, `date` date NOT NULL, `invoice_num` int(35) NOT NULL default '0', `conf_num` int(35) NOT NULL default '0', `fname` text, `lname` text, `bill_add` varchar(255) default NULL, `bill_city` varchar(255) default NULL, `bill_zip` varchar(255) default NULL, `bill_state` text, `bill_country` text, `ship_add` varchar(255) default NULL, `ship_city` varchar(255) default NULL, `ship_zip` varchar(255) default NULL, `ship_state` text, `ship_country` text, `terms` varchar(255) default NULL, `item_num` int(35) NOT NULL default '0', `desc` varchar(255) default NULL, `quantity` int(11) NOT NULL default '0', `price` varchar(255) default NULL, `amount` varchar(255) default NULL, `sh` varchar(255) default NULL, `total` varchar(255) default NULL, `ccard` varchar(255) default NULL, `color` int(3) NOT NULL default '0', `label` varchar(255) default NULL, `email` varchar(255) default NULL, `phone` varchar(255) default NULL, `order_date` date NOT NULL, `inv_total` int(11) NOT NULL default '0', `inv_minus_sales` int(11) NOT NULL default '0', `trees_sold` int(11) NOT NULL default '0', `trees_gifted` int(11) NOT NULL default '0', `trees_comp` int(11) NOT NULL default '0', `unit_cost` varchar(255) default NULL, `sub_total` varchar(255) default NULL, `tax` varchar(255) default NULL, `total_paid` varchar(255) default NULL, `payment_method` text, `notes` varchar(255) default NULL, `date_sent` date NOT NULL, `attn` varchar(255) default NULL, `seedlings` int(11) NOT NULL default '0', `four_four` varchar(255) default NULL, `hear_about` varchar(255) default NULL, `order_emp` varchar(255) default NULL, `comm_fname` text, `comm_lname` text, `comm_total` varchar(255) default NULL, `comm_date_paid` date NOT NULL, PRIMARY KEY (`spreadsheetid`) ) ENGINE=MyISAM AUTO_INCREMENT=62 DEFAULT CHARSET=latin1; Quote Link to comment https://forums.phpfreaks.com/topic/196345-mysql-error-report/#findComment-1031168 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.