致命错误:在第 105 行调用 /webshop/index.php 中未定义的函数 tep_db_fetch_assoc()

发布于 2024-09-26 22:47:54 字数 1558 浏览 0 评论 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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

做个ˇ局外人 2024-10-03 22:47:54

tep_db_fetch_assoc 不存在。您可能缺少定义该函数的文件,或者函数名称不正确。尝试使用 tep_db_fetch_array 来查看它是否返回一个像 tep_db_fetch_assoc 应该返回的关联数组。

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.

烟火散人牵绊 2024-10-03 22:47:54

我不认为tep_db_fetch_assoc是php的函数,它是一个自定义函数。 确保您包含包含该函数的库/类/文件

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文