Uhg, I think that means my innerJoin() isn’t working. That code you supplied produced the following:
Array
(
[product_id] => 43
[model] => Product 16
[sku] =>
[location] =>
[quantity] => 9
[stock_status_id] => 5
[image] => data/macbook_1.jpg
[manufacturer_id] => 8
[shipping] => 0
[price] => 500
[tax_class_id] => 9
[date_available] => 2009-02-03
[weight] => 0
[weight_class_id] => 1
[length] => 0
[width] => 0
[height] => 0
[length_class_id] => 2
[status] => 1
[date_added] => 2009-02-03 21:07:49
[date_modified] => 2010-03-25 14:37:30
[viewed] => 0
[sort_order] => 0
[subtract] => 1
[minimum] => 1
[cost] => 0
)
Unfortunately, that is only the data from the table "products".
(I didn’t put it in the loop, because I assumed I’d only need the info for one product to see if "name" was included)
The query on the other hand looks good aside from the selection:
(It isn’t selecting any of the fields from ProductDescription, although the JOIN syntax is there..?)
Array
SELECT `Product`.`product_id` AS `Product_product_id`, `Product`.`model` AS `Product_model`, `Product`.`sku` AS `Product_sku`, `Product`.`location` AS `Product_location`, `Product`.`quantity` AS `Product_quantity`, `Product`.`stock_status_id` AS `Product_stock_status_id`, `Product`.`image` AS `Product_image`, `Product`.`manufacturer_id` AS `Product_manufacturer_id`, `Product`.`shipping` AS `Product_shipping`, `Product`.`price` AS `Product_price`, `Product`.`tax_class_id` AS `Product_tax_class_id`, `Product`.`date_available` AS `Product_date_available`, `Product`.`weight` AS `Product_weight`, `Product`.`weight_class_id` AS `Product_weight_class_id`, `Product`.`length` AS `Product_length`, `Product`.`width` AS `Product_width`, `Product`.`height` AS `Product_height`, `Product`.`length_class_id` AS `Product_length_class_id`, `Product`.`status` AS `Product_status`, `Product`.`date_added` AS `Product_date_added`, `Product`.`date_modified` AS `Product_date_modified`, `Product`.`viewed` AS `Product_viewed`, `Product`.`sort_order` AS `Product_sort_order`, `Product`.`subtract` AS `Product_subtract`, `Product`.`minimum` AS `Product_minimum`, `Product`.`cost` AS `Product_cost` FROM `opcart_product` AS `Product` JOIN `opcart_product_description` `PD` ON Product.product_id = PD.product_id ORDER BY Product.date_added
Adding the select() call from my original snippet results in an Internal Server Error (nothing in logs). Am I correct in assuming that selection should be automatically generated based upon the join? All of the examples in the docs are without a select() call (even with innerJoin()’s), so I assume this to be the case.
Thanks for sending that extra line of code to further debug!
-Jared