[Tep-j-general] Re: レンタルサーバーでの運用

Back to archive index

TAMURA Toshihiko tamur****@bitsc*****
2004年 1月 18日 (日) 12:13:11 JST


こんにちは、田村です。

今回の場合は、次の3段階で問題が発生する可能性があるように思います。

1. ブラウザ => サーバ
   入力した文字列が(文字コードも含めて)正常に受け取れているか。
2. osCommerce => MySQL
   正常なSQLが作られているか。
3. MySQL
   SQLを与えて正常な検索結果が返るか。

3.については、phpMyAdminなどで直接SQLを入力してみるのが簡単です。
例えば 'マウス' という単語を検索したとすると、
実際に実行されるSQLは次のようになりますので、
これを実行してみればどうでしょうか。

select distinct p.products_image, m.manufacturers_name,  m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id  and ((pd.products_name like '%マウス%' or p.products_model like '%マウス%' or m.manufacturers_name like '%マウス%') ) order by pd.products_name;

2.は、管理画面からSQLのログを落とすことができますので、
そこにEUCコードで上と同じようなSQLが記録されているのを
確認すればいいです。

-- 
田村敏彦 / 株式会社ビットスコープ
E-mail:tamur****@bitsc*****
http://www.bitscope.co.jp/




Tep-j-general メーリングリストの案内
Back to archive index