zhaopeterson Posted October 24, 2011 Share Posted October 24, 2011 Hi, Larry: On page 170 when you define orders and order_contents you used "innoDB" engine as you indicated on page 172 InnoDB supports transaction. I downloaded your sql.sql file (inside ex2) a week or so ago and realized the "orders" and "order_contents" were defined as MyISAM Here is copy/paste from your sql file 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=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `order_contents` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `order_id` int(10) unsigned NOT NULL, `product_type` enum('coffee','other','sale') DEFAULT NULL, `product_id` mediumint(8) unsigned NOT NULL, `quantity` tinyint(3) unsigned NOT NULL, `price_per` decimal(5,2) unsigned NOT NULL, `ship_date` date DEFAULT NULL, PRIMARY KEY (`id`), KEY `ship_date` (`ship_date`), KEY `product_type` (`product_type`,`product_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Was it an error on the sql file or some updates I missed reading? Thanks, Brooke Link to comment Share on other sites More sharing options...
Todd.M Posted October 29, 2011 Share Posted October 29, 2011 This would help me out as well. My thoughts on this is that the php is handling the transactions and the tables are handling the information storage so setting the ENGINE=MyISAM will work correctly. (reading for PHP 6 & MySQL 5 ver3, and Effortless E-Commerce) Todd Link to comment Share on other sites More sharing options...
Larry Posted November 3, 2011 Share Posted November 3, 2011 Sorry about that. Yes, it should be InnoDB. I'll get it corrected in the downloads. Thanks for catching it! Link to comment Share on other sites More sharing options...
Recommended Posts