When doing something like
$order = new Order(1);
$products = $order->buildProducts();
I get an error like the following:
MySQL error (Unknown column 'orders{order_id}.id' in 'where clause') in SELECT order_products
.* FROM order_products
WHERE orders{order_id}
.id
= 1 ORDER BY order_products
.id
ASC
My order_products table has the following definition in MySQL:
CREATE TABLE `order_products` (
`id` int(11) NOT NULL auto_increment,
`order_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `order_id` (`order_id`),
KEY `product_id` (`product_id`),
CONSTRAINT `order_products_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`),
CONSTRAINT `order_products_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Thanks.