Jump to content



Photo

Latest Sql.Sql Download File


  • Please log in to reply
2 replies to this topic

#1 zhaopeterson

zhaopeterson

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 24 October 2011 - 2:03 AM

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
  • 0

#2 Todd.M

Todd.M

    Newbie

  • Members
  • Pip
  • 16 posts

Posted 29 October 2011 - 3:43 AM

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
  • 0

#3 Larry

Larry

    Administrator/Writer

  • Administrators
  • 3,906 posts
  • LocationState College, PA (USA)

Posted 3 November 2011 - 12:49 PM

Sorry about that. Yes, it should be InnoDB. I'll get it corrected in the downloads. Thanks for catching it!
  • 0