[eluser]daweb[/eluser]
Hi guys,
I'm trying to print an image stored in a blob field. I read a lot of posts, but I can't be able to print image correctly.
In my view I have
Code:
img src="<?php echo site_url('ad/showimage/' . $row->user_id); ?>" alt="Foto Personale di <?php echo $row->nome; ?> <?php echo $row->cognome; ?>" title="Foto Personale di <?php echo $row->nome; ?> <?php echo $row->cognome; ?>" width="50" height="50" />
,
where user_id is the id of the record that contains blob.
In the showimage controller I have, in my 'modello' the query to retrieve the correct record
Code:
$id_user = $this->uri->segment($this->uri->total_segments());
$row = $this->modello->get_data($id_user, "user", 'user_id');
$data['row'] = $row;
$this->load->view('admin/iscritti/showimage_view',$data);
And finally the view that print the image:
Code:
header("Content-type: jpeg");
print ($row->user_photo);
Nothing to do, I can't see image.
What'w wrong?! Can u help me, please?!