Fatal error: Call to undefined function tep_db_fetch_assoc() in /webshop/index.php on line 105

StackOverflow https://stackoverflow.com/questions/3897311

  •  29-09-2019
  •  | 
  •  

문제

someone made me a piece of code, but after implementing the snippet, the error in the title accured.

This is the snippet:

It seems tep_db_fetch_assoc() is defined as $row, is this true, and why do I get this error then?

// 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
도움이 되었습니까?

해결책

tep_db_fetch_assoc Doesn't exist. You are are either missing a file that defines that function or the function name is incorrect. Try using the tep_db_fetch_array to see if it returns an assosciative array like tep_db_fetch_assoc is supposed to.

다른 팁

I don't think tep_db_fetch_assoc is php's function, it is a custom function. Make sure that you are including the library/class/file which contains that function.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top