Hello all,

I've a problem on displaying an image which come from a blob field in my sql joomla database table.

My used code is :

in my controller.php file :

function showImage()
	 {
	    $connexion = mysql_connect("localhost", "root", "123456") or exit (mysql_error());
	    $database = mysql_select_db("joomla")or exit (mysql_error());
        $idMatche = '3';
        $apercu = mysql_query("SELECT extension2,img2 FROM jos_prifoot WHERE id = ".$idMatche) or exit (mysql_error());
        if(mysql_num_rows($apercu) != 1);
		else
		{
        $reponse = mysql_fetch_assoc($apercu);
        header ("Content-type: ".$reponse['extension']);
	
		echo $reponse['img2'];
		 
	    } 
        mysql_close();
     }

and in the default.php file :

<img src="<?php echo JRoute::_('index.php?option=com_prifoot&image/gif=3&task=showImage'); ?>"></img>

but the problem is that i have the following result :

GIF89a� ��������������f� � ����ff���������������]� !�f�����

Any one have an idea.

Any help will be very appreciated.

Thank You.

typo?

header ("Content-type: ".$reponse['extension2']);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.