From: Joe Hunt Date: Thu, 3 May 2007 22:45:29 +0000 (+0000) Subject: Multiple tables and JOIN's have syntax changes in MySQL 5.0.12. Need parentheses. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=5d5b64445be942db689dfc13ef030fc96aa06e95;p=textcart.git Multiple tables and JOIN's have syntax changes in MySQL 5.0.12. Need parentheses. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 29510e0..55191e9 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,12 @@ Legend: ! -> Note $ -> Affected files +03-May-2007 Joe Hunt + # Multiple tables and JOIN's have syntax changes in MySQL 5.0.12. Need parentheses. + $ /includes/db/manufacturing_db.inc + /manufacturing/includes/db/work_order_requirements_db.inc + + 02-May-2007 Joe Hunt # Missing details on Purchase Order when emailing and printing $ /reporting/rep209.php diff --git a/includes/db/manufacturing_db.inc b/includes/db/manufacturing_db.inc index 0c91583..f924916 100644 --- a/includes/db/manufacturing_db.inc +++ b/includes/db/manufacturing_db.inc @@ -20,7 +20,7 @@ function get_bom($item) ".TB_PREF."stock_master.description, ".TB_PREF."stock_master.mb_flag AS ResourceType, ".TB_PREF."stock_master.material_cost+ ".TB_PREF."stock_master.labour_cost+".TB_PREF."stock_master.overhead_cost AS standard_cost, units, ".TB_PREF."bom.quantity * (".TB_PREF."stock_master.material_cost+ ".TB_PREF."stock_master.labour_cost+ ".TB_PREF."stock_master.overhead_cost) AS ComponentCost - FROM ".TB_PREF."workcentres, ".TB_PREF."locations, ".TB_PREF."bom INNER JOIN ".TB_PREF."stock_master ON ".TB_PREF."bom.component = ".TB_PREF."stock_master.stock_id + FROM (".TB_PREF."workcentres, ".TB_PREF."locations, ".TB_PREF."bom) INNER JOIN ".TB_PREF."stock_master ON ".TB_PREF."bom.component = ".TB_PREF."stock_master.stock_id WHERE ".TB_PREF."bom.parent = '" . $item . "' AND ".TB_PREF."workcentres.id=CAST(".TB_PREF."bom.workcentre_added AS UNSIGNED) AND ".TB_PREF."bom.loc_code = ".TB_PREF."locations.loc_code ORDER BY ".TB_PREF."bom.id"; diff --git a/manufacturing/includes/db/work_order_requirements_db.inc b/manufacturing/includes/db/work_order_requirements_db.inc index b96507d..8bee3cf 100644 --- a/manufacturing/includes/db/work_order_requirements_db.inc +++ b/manufacturing/includes/db/work_order_requirements_db.inc @@ -6,7 +6,7 @@ function get_wo_requirements($woid) ".TB_PREF."stock_master.mb_flag, ".TB_PREF."locations.location_name, ".TB_PREF."workcentres.name AS WorkCentreDescription FROM - ".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres INNER JOIN ".TB_PREF."stock_master ON + (".TB_PREF."wo_requirements, ".TB_PREF."locations, ".TB_PREF."workcentres) INNER JOIN ".TB_PREF."stock_master ON ".TB_PREF."wo_requirements.stock_id = ".TB_PREF."stock_master.stock_id WHERE workorder_id=$woid AND ".TB_PREF."locations.loc_code = ".TB_PREF."wo_requirements.loc_code diff --git a/sql/en_US-demo.sql b/sql/en_US-demo.sql index fbaf94b..d385eee 100644 --- a/sql/en_US-demo.sql +++ b/sql/en_US-demo.sql @@ -1916,7 +1916,7 @@ INSERT INTO `0_stock_master` VALUES ('102', 1, 1, '17 inch VGA Monitor', '', 'ea INSERT INTO `0_stock_master` VALUES ('103', 1, 1, '32MB VGA Card', '', 'each', 'B', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0); INSERT INTO `0_stock_master` VALUES ('104', 1, 1, '52x CD Drive', '', 'each', 'B', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0); INSERT INTO `0_stock_master` VALUES ('201', 2, 1, 'Assembly Labour', '', 'each', 'D', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0); -INSERT INTO `0_stock_master` VALUES ('3400', 3, 1, 'P4 Business System', '', 'each', 'M', '3000', '4010', '1420', '4210', '0', NULL, NULL, 0, 0, 0, 0, 0); +INSERT INTO `0_stock_master` VALUES ('3400', 3, 1, 'P4 Business System', '', 'each', 'M', '3000', '4010', '1420', '4210', '1400', NULL, NULL, 0, 0, 0, 0, 0); -- -- Data in table `stock_moves`