Seiji Sogabe
sogab****@alles*****
2005年 12月 20日 (火) 23:31:36 JST
曽我部です。 karu wrote: > とエラーが出てしまいます。 > これはわたしの書き方が間違っているということなのでしょうか? > > ご教授いただけないでしょうか。よろしくお願いいたします。 > > MySQL バージョン:4.0.26 > > 以下、今回エラーがでるものです。 > if ($products_model{0} == '9') { > $sql = tep_db_query("select p.products_id, p.products_image, p.products_model from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); ここは、tep_db_queryは必要ないです。 $sql = "select ... でいいとおもいます。 > } else { > $sql = tep_db_query("select p.products_id, p.products_image, p.products_model from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and p.products_model < 90000 group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); ここも同様です。 > } > $orders_query = tep_db_query($sql); ここで、tep_db_queryしているので。 では。 -- sogab****@alles*****