I want to get a value from a table like that:
SELECT id_image FROM `ps_image` WHERE id_product = 903 limit 1
How can i integrate this sql command in prestashop?
答案 0 :(得分:1)
$product_id = '903';
$query = Db:: getInstance()->getRow(
'SELECT id_image FROM '._ DB_PREFIX_.'image WHERE id_product ='. $product_id
);
使用$ query变量获取图像的id。