0

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.

Edited by nav33n: Please use [code] [/code] tags to wrap your code for easy readability.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.