I have an issue on displaying an image on a simple array Here is my problem :
<?php
session_start();
include("/connect.php");
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="JeuCSS.css"/>
</head>
<body>
<h1><center>SUDOKU</center></h1>
<?php
$taille=9;
print "<center><table>";
for ($l = 1; $l <= $taille; $l++ ) {
print "<tr>";
for ($c = 1; $c <= $taille; $c++){
$parse_select = oci_parse($dbConn,
"SELECT I.lien_image
FROM Image I, Cases C
WHERE C.X_case = $l
AND C.Y_case = $c
AND C.num_grille = 31
AND C.num_image=I.num_image");
if (!$parse_select) {
$e = oci_error($dbConn);
echo htmlentities($e['message']);
}
// Exécution de la logique de la requête
$req = oci_execute($parse_select);
if (!$req) {
$e = oci_error($parse_select);
echo(htmlentities($e['message']));
}
// Récupération de l'image
$img_link = oci_fetch_array($parse_select, OCI_ASSOC+OCI_RETURN_NULLS);
$test=current($img_link);
echo "<td id = \"l".$l."c".$c."\" > <img src='".$test."' width='98px' height='85px' /></td>";
}
print "</tr>";
}
print "</table></center>";
?>
<p id="niveau">test</p>
</body>
</html>
CSS :
body{font-family:arial;background-color:white;color:black}
table {border-collapse:collapse;border:medium solid;text-align:center}
td{height:85px;width:98px;border: medium solid}
/*#c1l1 {background-color:red}*/
So the code is correct when I manually type the link of an image instead of "$test" Also the SQL query is correct if I test it on some values. I personnally think that the "$l" or "$c" are not correctly read by php Or maybe that the "$test" variable is correct but isn't read by the src attribute. Could you help please ? Thanks