I wrote this code to display an image:
<?php
$sel = " SELECT *
FROM immagini
WHERE id= ".$_GET['idx'];
$ris = mysqli_query($con,$sel);
$count = mysqli_num_rows($ris);
if($count >= 1) echo "<h1>Dettagli dello studente: </h1>";
while ( $riga = mysqli_fetch_array($ris)) {
echo "ID = ".$riga['id']; ?> <br > <?php
echo "Nome = ".$riga['name']; ?> <br > <?php
echo "Descrizione = ".$riga['descrizione']; ?> <br > <?php
$imageData= $riga["image"];
header("content-type :image/jpeg");
echo $imageData;
}
?>
But the result is this:
Dettagli dello studente: ID = 2 Nome = julia Descrizione = Questo frattale ha delle caratteristiche particolari, in quanto..... ����JFIF,,��C !"$"$��C����� ���}!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������� ���w!1AQaq"2�B���� #3R�br� $4�%�&'()56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?��ĺޙ��}cW�6�Pm�$ύ�p����7���bjT��8�������?��?�A�.����W��>�����E�W3/�����-��K��XI~��}�%�6����A\�;�8$��^I�U}���k��]���L�< ��Q�����l�4��ܗ��ӳ������� �gK�f�g���� y4���F@�� ��gC+���-+7�(���}�� �fhA�o����*��������u���b���?m���t#�:u������]#Ȯ� �Tѕ����{���˯�7I�j�� �_R3�P�|d��+���u��%�+�1?�������+���u6c���w�m�����5H���o�m�����5@�5/�����w�j��j_���:7� �����Կ�to�����?��~�����+���T�R� ��ѿ�Ww�ƨ�����C������P� I�;�9�� ����;��P��_�3�q� ˯�7T��.��+�h��>��7'��w�j�r�ڋ��1W�����w�Ʃ�..� 4�B�R� ��ѿ�Ww�Ʃ?��~�����+���T�R� ��ѿ�Ww�ƨ�����C������P� K�7��F��]������o�������5@�5/����w�j��jO���9�� �����ԟ��so�����j-��?�����m�����7U(J;�;�����3o�����J �1����"�q��������{ ���L|���?� ���u�r�L����Qob������^)f�?���N�Y^;���mK R��8������3���X�Z;���)�X��?�e��7|3���#��sg8��*>�S������Ͽ��e~/�=9��������>�}��V�/�����$O�>w �����I���N��A>�R�����,��/��]�z}��&����ac�~O��4_�#(5Sϭ�����j����|dw���̵��97���틏�K��/�Gx�(���y���f��K��=H��F���?���.x��rB�mi�����7�Q�".F/�Ɲ�?����!�������8x��O��;�{����i������x���(��F'�ޛ�?����#�r�i��^����G��{9 �������8��G�����u�(u���m���G�g�Q��g�^��� ~�=����Q�i��.y�q�i�t�� u�4u�?����!�!��iK������{H������(#;�yj��i�:�GOz=�E��{$r?>[9I|F2?�i3�%Z���Ռϗ�����N_� �8���pO�x�t?ܭcFr�n#_�UY��t��/�� ��(S��e�wF���;�y�_N:�t'��8Ez��7)�d����;���3 'T�����N��'�,�wBx�3ұ���K+�Fr���鶝|���'��,�?�����@��;E����t���CR%��!�x�F�]n�����G�)�d�Q��H�
How can i solve this problem????? I think there is a problem with the conversion of the image. Thanksss.
";` – James Mar 17 '15 at 16:56