Sameh Sameh - 2 years ago 117
PHP Question

Query get specific value in opencart

Im biggner in opencart my issue is I add field in product table called (model_choice) , in the product.tpl page in path (catalog/view/theme/default/template/product/product.tpl) I want to get the value of the row (model_choice) for the selected product I already get the product id with

I try to get the value of (model_choice) with

$sql = $this->db->query('SELECT model_choice
FROM '.DB_PREFIX.'product
WHERE product_id = ' . $this->request->get['product_id']);
$id = $sql ->model_choice;

Answer Source

$id = $sql->row['model_choice']; - Try this.

print_r($sql->rows); \\Shows all results.

Refer this link: How to become an OpenCart guru?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download