--- modules/ec_live_subproducts/ec_live_subproducts.module	Thu Mar 22 15:05:06 2007
+++ ec_live_subproducts.module	Thu Mar 22 15:00:10 2007
@@ -635,8 +635,8 @@
       break;
     case "update":
       if ($node->type == "ec_live_subproducts_attribute") {
-        $categ = db_fetch_array(db_query("SELECT GROUP_CONCAT(DISTINCT(categ_data.name)) as CATEGORY FROM ec_live_subproducts_attribute a INNER JOIN term_node categ ON categ.nid = a.nid INNER JOIN term_data categ_data ON categ.tid = categ_data.tid WHERE categ_data.vid = %d and a.nid = %d", variable_get("ec_live_subproducts_combination_cat", 0), $node->nid));
-        $forbid = db_fetch_array(db_query("SELECT GROUP_CONCAT(DISTINCT(categ_data.name)) as FORBIDDEN FROM ec_live_subproducts_attribute a INNER JOIN term_node categ ON categ.nid = a.nid INNER JOIN term_data categ_data ON categ.tid = categ_data.tid WHERE categ_data.vid = %d and a.nid = %d", variable_get("ec_live_subproducts_combination_forbid", 0), $node->nid));
+        $categ = db_fetch_array(db_query("SELECT GROUP_CONCAT(DISTINCT(categ_data.name)) as CATEGORY FROM {ec_live_subproducts_attribute} a INNER JOIN {term_node} categ ON categ.nid = a.nid INNER JOIN {term_data} categ_data ON categ.tid = categ_data.tid WHERE categ_data.vid = %d and a.nid = %d", variable_get("ec_live_subproducts_combination_cat", 0), $node->nid));
+        $forbid = db_fetch_array(db_query("SELECT GROUP_CONCAT(DISTINCT(categ_data.name)) as FORBIDDEN FROM {ec_live_subproducts_attribute} a INNER JOIN {term_node} categ ON categ.nid = a.nid INNER JOIN {term_data} categ_data ON categ.tid = categ_data.tid WHERE categ_data.vid = %d and a.nid = %d", variable_get("ec_live_subproducts_combination_forbid", 0), $node->nid));
         db_query("UPDATE {ec_live_subproducts_attribute} set pricevariation=%f, stock=%d, sku='%s', category='%s', forbidden='%s' WHERE nid=%d", $node->pricevariation, $node->stock, $node->sku, $categ["CATEGORY"], $forbid["FORBIDDEN"], $node->nid);
       }
       elseif (empty($node->pparent)) {
@@ -720,7 +720,7 @@
   if (arg(3) == "cron") {$output = ec_live_subproducts_cron();}
   if (!$pproducts = ec_live_subproducts_pproduct_get()) {return t("There are no parent products available.");}
   foreach ($pproducts as $pproduct) {
-    $actual_children = db_fetch_array(db_query("SELECT COUNT(nid) FROM ec_product WHERE pparent = %d", $pproduct->nid));
+    $actual_children = db_fetch_array(db_query("SELECT COUNT(nid) FROM {ec_product} WHERE pparent = %d", $pproduct->nid));
 //     $possible_children = $num_attributes = 0;
 //     $current_variation = NULL;
 //     foreach ($pproduct->pproduct_attributes as $attribute) {
@@ -859,10 +859,10 @@
 function ec_live_subproducts_pproduct_get($id = NULL, $only_nid = NULL) {
   if (empty($id)) {
     $pproduct_types = module_invoke_all("productapi", NULL, "subproduct_types");
-    $pproducts = db_query("SELECT nid FROM ec_product WHERE pparent = 0 AND ptype IN ('%s');", implode("','", $pproduct_types));
+    $pproducts = db_query("SELECT nid FROM {ec_product} WHERE pparent = 0 AND ptype IN ('%s');", implode("','", $pproduct_types));
   }
   else {
-    $pproducts = db_query("SELECT nid FROM ec_product WHERE nid = %d;", $id);
+    $pproducts = db_query("SELECT nid FROM {ec_product} WHERE nid = %d;", $id);
   }
   while ($pproduct = db_fetch_object($pproducts)) {
     if (empty($only_nid)) {
