mysql - Magento 中哪个表保存主图像的信息

标签 mysql magento e-commerce magento-1.8

哪个数据库表保存了 Magento 中产品的图像的信息?

我看了

  • catalog_product_entity_media_gallery
  • 和catalog_product_entity_varchar

但看不到一张图像是如何标记为主(基本)图像的。

Magento 版本:1.8.1.0

最佳答案

此信息存储在catalog_product_entity_varchar中。

在从数据库获取此信息之前,您必须知道基本图像属性的 attribute_id,您可以通过以下方式获取此 id:

SELECT `attribute_id` FROM eav_attribute where `attribute_code` ='image' AND entity_type_id = 4;

对我来说结果是85,现在如果我们想要获取id为1020的产品的基本图像信息:

SELECT * FROM catalog_product_entity_varchar where `attribute_id`=85 and `entity_id`=1020

希望有帮助。

关于mysql - Magento 中哪个表保存主图像的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26983379/

相关文章:

php - 如何使用php根据mysql表中的数据自动创建div?

asp.net-mvc - Windows Azure + Asp.Net MVC + 电子商务

mysql - SQL查询-根据计数条件选择记录

mysql - 控制台显示->是什么意思?

php - Magento 2 覆盖核心框架

ajax - Magento - Controller 到 Ajax 预计发货 : Load Block and display phtml

java - 如何在jComboBox中显示多个字段但只在数据库中插入一个字段?

python - PostgreSQL 数据库可以拥有的表的数量是否有限制?

javascript - HTML 表格行为被 JavaScript 改变了?

e-commerce - 通过卡号识别是 "Credit card"还是 "Debit card"