0

誰かが私にコードを作ってくれましたが、スニペットを実装した後、タイトルのエラーが発生しました。

これはスニペットです:

tep_db_fetch_assoc() が $row として定義されているようですが、これは本当ですか?なぜこのエラーが発生するのですか?

// Start auto fetch category image from product
if($categories['categories_image'] == "") {
$categories_img_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " p, products_to_categories pc WHERE p.products_id = pc.products_id AND pc.categories_id = '{$categories['categories_id']}' AND p.products_image IS NOT NULL order by p.products_id ASC");

while ($row = tep_db_fetch_assoc($categories_img_query)) { 
  if ($row['products_image'] <> 'noimage.jpg' 
     or !isset($categories['categories_image']) 
  ) { 
     $categories['categories_image'] = $row['products_image']; 
  } 
} 
else {
 $categories_img_parent_query = tep_db_query("select categories_id from categories WHERE parent_id = '{$categories['categories_id']}'");

 while($categories_img_parent = tep_db_fetch_array($categories_img_parent_query)) {
   $categories_img_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " p, products_to_categories pc WHERE p.products_id = pc.products_id AND pc.categories_id = '{$categories_img_parent['categories_id']}' AND p.products_image IS NOT NULL order by p.products_id ASC");
   while ($row = tep_db_fetch_assoc($categories_img_query)) { 
  if ($row['products_image'] <> 'noimage.jpg' 
     or !isset($categories['categories_image']) 
  ) { 
     $categories['categories_image'] = $row['products_image']; 
  } 
} 
 }
}
}
// End auto fetch category image from product
4

2 に答える 2

0

tep_db_fetch_assoc 存在しません。その関数を定義するファイルがないか、関数名が間違っています。tep_db_fetch_array を使用して、tep_db_fetch_assoc が想定しているような連想配列を返すかどうかを確認してください。

于 2010-10-09T18:25:19.147 に答える
0

tep_db_fetch_assocphp の関数ではないと思います。カスタム関数です。その関数を含むライブラリ/クラス/ファイルを含めていることを確認してください

于 2010-10-09T18:26:56.840 に答える