포럼: osCommerce FAQ (Thread #30588)

商品のコピーができない (2011-10-13 01:54 by masa #60033)

商品を別カテゴリーに重複コピーをしようとすると以下のメッセージがでてきてしまい。うまくできません。
商品のリンクコピーは問題なく出来ます。
どのようにすれば、重複コピーができるようになるのでしょうか?


1062 - Duplicate entry '0-73' for key 'PRIMARY'

insert into products_to_categories (products_id, categories_id) values ('0', '73')

[TEP STOP]

Reply to #60033×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-18 13:56 by Anonymous #60105)

products_idが0になるのはおかしいので
ここが何故0になるのか調べる必要があるかと

$dup_products_id = tep_db_insert_id();

なので、その前処理(TABLE_PRODUCTSへのinsert)から
失敗している可能性が高い

Reply to #60033

Reply to #60105×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-19 05:34 by Anonymous #60113)

有難うございます。
ご指摘いただいたところを調べてみようと思います。
Reply to #60033

Reply to #60113×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-25 21:24 by Anonymous #60204)

ご指摘いただいたところを調べて、調整してみたところ、
エラーメッセージは出なくなったのですが、
今度はコピーをするとコピー先の画面に切り替わるものの、
コピーしたはずの商品が表示されないという問題が発生しています。

現象発生時のデータベースの状況としては
productsにコピーしたはずのデータが作られていない。
product_to_categoriesにはproduct_id = 0 のデータがInsertされている。
product_descriptionにはコピーしたデータが登録されている。

といった状況です。
拙い説明で恐縮ですが、どなたかこの状況の改善策をご指摘いただけますでしょうか?
よろしくお願いいたします。
Reply to #60033

Reply to #60204×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-26 09:24 by Anonymous #60205)

表示されないじゃなく出来てないということは
TABLE_PRODUCTSが壊れてるとか
http://dev.mysql.com/doc/refman/4.1/ja/check-table.html
Reply to #60204

Reply to #60205×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-28 01:31 by Anonymous #60237)

>表示されないじゃなく出来てないということは
>TABLE_PRODUCTSが壊れてるとか
http://dev.mysql.com/doc/refman/4.1/ja/check-table.html

上記サイトを参考に、チェックしてみましたが、
テーブルに異常はありませんでした。
新規登録時はTABLE_PRODUCTSにデータが作られているのですが。
Reply to #60205

Reply to #60237×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-28 14:37 by Anonymous #60244)

categories.phpの259行、262行のtep_db_queryをechoに変えるか
「データベース問い合わせを記録」をtrueにするとかして
実際に投げてるSQLを取得するしか無さそう

ここの処理はただ読み出した値を書き込んでるだけで
あまり引っかかるところとは思えないけど
Reply to #60237

Reply to #60244×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-26 19:21 by Anonymous #60217)

有難うございます。
チェックしてみます。
Reply to #60033

Reply to #60217×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-26 19:21 by Anonymous #60218)

有難うございます。
チェックしてみます。
Reply to #60033

Reply to #60218×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: 商品のコピーができない (2011-10-26 19:22 by Anonymous #60219)

有難うございます。
チェックしてみます。
Reply to #60033

Reply to #60219×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login