e-mazed Posted November 5, 2012 Share Posted November 5, 2012 Hi I am trying to create the orders table and I am using MAMP - I copied your tables exactly from your downloaded file ex2 SQL SQL. but the only table that won't work is the orders table: CREATE TABLE `orders` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `customer_id` int(10) unsigned NOT NULL, `total` decimal(7,2) unsigned DEFAULT NULL, `shipping` decimal(5,2) unsigned NOT NULL, `credit_card_number` mediumint(4) unsigned NOT NULL, `order_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `customer_id` (`customer_id`), KEY `order_date` (`order_date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; It won't accept the total column for some reason - pls help Link to comment Share on other sites More sharing options...
HartleySan Posted November 5, 2012 Share Posted November 5, 2012 Not sure what to tell you, e-mazed, but I just fired up XAMPP on Windows, made a sample DB, and copied your table creation SQL code into phpMyAdmin, and it created the table without any problems. There must be a conflict with something else, because the syntax itself seems fine. Link to comment Share on other sites More sharing options...
e-mazed Posted November 5, 2012 Author Share Posted November 5, 2012 Thanks - i am completely lost on this one - Just so i am following the same path as you - I created a database called ecommerces2 - then at the top i have a structure tab - followed by a SQL tab - in that tab I dumped the above code and selected "go" - when i do that i am returned with this #1146 - Table 'ecommerces2.orders' doesn't exist Link to comment Share on other sites More sharing options...
e-mazed Posted November 5, 2012 Author Share Posted November 5, 2012 Ok not sure why - but I have another computer and I copied the entire MAMP folder over from one to the other and the problem is resolved - so I will leave this one as a mystery that has been resolved 1 Link to comment Share on other sites More sharing options...
Edward Posted November 5, 2012 Share Posted November 5, 2012 Hi I am trying to create the orders table and I am using MAMP - I copied your tables exactly from your downloaded file ex2 SQL SQL. but the only table that won't work is the orders table: CREATE TABLE `orders` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `customer_id` int(10) unsigned NOT NULL, `total` decimal(7,2) unsigned DEFAULT NULL, `shipping` decimal(5,2) unsigned NOT NULL, `credit_card_number` mediumint(4) unsigned NOT NULL, `order_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `customer_id` (`customer_id`), KEY `order_date` (`order_date`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; It won't accept the total column for some reason - pls help Try removing the backticks from the SQL code then run it through phpmyadmin. Link to comment Share on other sites More sharing options...
HartleySan Posted November 5, 2012 Share Posted November 5, 2012 Must be something weird about your work environment. Since I don't use MAMP, I can't help. Sorry. If you figure out the problem though, please let us know. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts