Welcome Guest, Not a member yet? Register   Sign In
Error on ternary expression
#1

Hi all, i have some error regarding ternary expression, it displays me only the default picture even if you have saved the product pic.
on view i have added this line
<img src="<?php echo base_url(!empty($row['image']) ? $row['image'] :'uploads/product_image/default.jpg'); ?>" id="output"  class="rounded-md mt-3"/>
on model i get the product by id
//get product by id
    public function get_product_by_id($id){
$query = $this->db->get_where('products', array('id' => $id));
return $result = $query->row_array();
}
Reply


Messages In This Thread
Error on ternary expression - by Tajar_Dobro - 02-14-2022, 04:43 AM
RE: Error on ternary expression - by php_rocs - 02-14-2022, 07:41 AM
RE: Error on ternary expression - by Tajar_Dobro - 02-15-2022, 01:02 AM
RE: Error on ternary expression - by php_rocs - 02-15-2022, 08:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB