[英]Fatal error: Call to undefined function tep_db_fetch_assoc() in /webshop/index.php on line 105
有人為我編寫了一段代碼,但是在實現了代碼段之后,標題中的錯誤就累積了。
這是代碼段:
看來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
tep_db_fetch_assoc不存在。 您丟失了定義該功能的文件,或者功能名稱不正確。 嘗試使用tep_db_fetch_array查看是否返回像tep_db_fetch_assoc應該的關聯數組。
我不認為tep_db_fetch_assoc
是php的函數,它是自定義函數。 確保包括包含該函數的庫/類/文件 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.