I don't know why it doesn't work I am trying to view profile image. the path is in database and $data['pic'] shows the path but I think the syntax is wrong Thx in advance :)
<img src="/images/<?php echo $data['pic']->pic_path; ?>">
This is var_dump($data['pic']) as you see you see pic_path has a value in it
object(Profile_model)#3 (12) { ["user_id"]=> NULL ["username"]=> NULL ["f_name"]=> NULL ["l_name"]=> NULL ["phone"]=> NULL ["email"]=> NULL ["address"]=> NULL ["height"]=> NULL ["weight"]=> NULL ["goal"]=> NULL ["_connection":protected]=> object(PDO)#4 (0) { } ["pic_path"]=> object(Profile_model)#8 (12) { ["user_id"]=> NULL ["username"]=> NULL ["f_name"]=> NULL ["l_name"]=> NULL ["phone"]=> NULL ["email"]=> NULL ["address"]=> NULL ["height"]=> NULL ["weight"]=> NULL ["goal"]=> NULL ["_connection":protected]=> object(PDO)#9 (0) { } ["pic_path"]=> string(27) "5caf5df7b2ee68.41908466.jpg" } }
<img src="/images/<?php echo $data['pic']->pic_path; ?>">