我试图在产品页面中获取并显示所有可下载的文件。这是我的代码:
模型:
public function download_m($product_id) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_download WHERE product_id = '" . (int)$product_id . "'");
if ($query->num_rows) {
return array(
'product_id' => $query->row['product_id'],
'download_id' => $query->row['download_id']
);
}
}
控制器:
$download_m = $this->model_catalog_product->download_m($product_id);
看法:
print_r($download_m)
数据库:
如您所见,有两个 product_id 为95的可下载项目,但它只是返回3
not 3,4
。我做错了什么?