je suis nouveau en php et j ai un probleme d affichage d image avec mon code php, quelqu'un peut il m aider
voici le code
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_data = "localhost";
$database_data = "mbotedb";
$username_data = "root";
$password_data = "";
$data = mysql_pconnect($hostname_data, $username_data, $password_data) or trigger_error(mysql_error(),E_USER_ERROR);
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "longblob":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "longblob":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_data, $data);
$sql= mysql_query("SELECT image,image2,image3,image4 FROM images")or die(mysql_error());
// $result = mysql_query("$sql");
$row_data = mysql_fetch_assoc($sql);
$totalRows_data = mysql_num_rows($sql);
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<table style="width:99% ;" align="center">
<tr style="background-color:grey";>
<th>1</th>
<th>2</th>
<th>3</th>
<th>4</th>
</tr>
<?php do { ?>
<tr>
<tr>
<td><?php echo $row_data['image']; ?></td>
<td><?php echo $row_data['image2']; ?></td>
<td><?php echo $row_data['image3']; ?></td>
<td><?php echo $row_data['image4']; ?></td>
</tr>
</tr>
<?php } while ($row_data = mysql_fetch_assoc($sql)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($sql);
?>
et voila ce qu’il donne a l'affichage
Code : Tout sélectionner
ØÿàJFIFddÿìDuckyUÿîAdobedÀÿÛ„ ÿÀ,ôÿļ !1A"Qaq2 ‘B#¡±R3ÁÑb$ðSáñr‚’¢C4% cƒ“56'Td&!1AQaq"‘2ð¡±ÁÑáBR#br’ñ¢34‚ÿÚ?ïå €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P @( €P ž^V%¥¹ê¯µä›ëÊ‚Þÿ2†™ ‰,©RQ}ɬ!?â¥OR%BÞ"úTnç`ÚÍXw÷œïþFTŽJÿ(1²+IJN3C ¬uR\˜Ì·”zÝ)ØŸ§J’’|ŒRŠÕ³êïƒÞ–’ÌEËJCÊçéͦYÊ´ÿË67_âSj[º‰£+lµJýÏyç1CS’žµÄX1äòlAi¶Ðw–ã¼…E!+ò…´Tl,AµñÙÇGB_NX×âd¼GîÇËò]«»ôI\)3&Çz4éj_Ü%iuæ[õ–|¨)YqÇ®·©ÝuDnÛZ©"ãÃýØ÷5²sîžZƒ8^E;Ègê”!ˆ˜¦Xb"¥*Âçe…ÀfÝ%ª ¹HèþíLÏØ/å¼Ü^c—c9‹aåCȰ¸áIaÕ!·[s×iJu)P^ݪH±ºµÙít¡-«;•S©½|7™aù¶œÎ%`¥Ô%Å5¹*R ð%$‚/Ð xuF‹‹£.Õéà €P @( €P @( €P @( €P @( €P @( €P @( €óAaרPRÓtÜÛ]´W€¶r~YŒã)Ü“.ú!ñÜk.KŸ‘pÛL´‚·ŸñÓÃS¥"?tOÜ©¾ääÓÛÞ§ãp7<µzË*“!`).>´¨¥›Ù $¼¨A¨”œß”‘¼N|snåe9d´üÕ:Úˆq˜zÉBR‘£iC~T¶NÔØ\üI5fݤµ+Ü™cÉò¼>*)›0¤•:†Ðéº[ô’|å²lÑ=/ô½Oç6#¹<žQ5™ÑñÌI!l0ãn)Ç¿^š®n4BE‡‰ ZøN \L£uǸ¾c;۞šìvFYZÔ‡“½Ð…o$*ñ×ë¶~¤ª÷ñ¶•ÆOTL²I+¹ý¾ä®¢'iIާ=e2ì¨N©§A¹Tb¤¤¦ê×ȰG€ÒƼÊ<8–azGÀ™ÍÌcÚH\l˜s¨ëZÝÉ2Ñ— J²Â–ärÚö‚R}dŽ¥BúV0¹MxÎ)Ÿo¸]Êíf}Ìò1—
...