Bonjour.
Je cherche à afficher la miniature correspondant à l'image de la page liée, en sachant que je peux avoir uniquement les images 2, 3, 5, 1 dans cet ordre (dans le cas présent on a 1 à 8 dans l'ordre, mais je veux une totale maitrise de l'emplacement de chaque miniature)
J'ai actuellement uniquement l'image 1 qui s'affiche sur toutes les miniatures, mais le lien envoie bien vers la page voulue (en fait c'est un formulaire

). C'est une page nommée pagephoto2010.php, qui affiche la photo et des détails stockés dans une base MySQL.
Voici mon code:
Code PHP :
<?php
session_start();
?>
<?php virtual('/Connections/photosrailch.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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 "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_photosrailch, $photosrailch);
$query_Recordset2 = "SELECT * FROM pagephoto";
$Recordset2 = mysql_query($query_Recordset2, $photosrailch) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Document sans titre</title>
<link href="/mainz.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="80%" border="0" cellpadding="0">
<tr>
<td width="25%"><?php $valeur ="1"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?>
</td>
<td width="25%"><?php $valeur ="2"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?></td>
<td width="25%"><?php $valeur ="3"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?></td>
<td width="25%"><?php $valeur ="4"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?></td>
</tr>
<tr>
<td width="25%"><?php $valeur ="6"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?></td>
<td><?php $valeur ="6"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?></td>
<td><?php $valeur ="7"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?></td>
<td><?php $valeur ="8"; //Numéro d'image
$miniature = $row_Recordset2['No'] ;
echo "<form action='/pagephoto2010.php' target='_blank' method='post'>
<input type='hidden' name='valeur' value='$valeur'>
<input type='image' 'button' src='$miniature'/>
</form>\n"; ?></td>
</tr>
</table>
<p></p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
Je voudrais rajouter WHERE No='$valeur' à $query_Recordset2 = "SELECT * FROM pagephoto"; pour la sélection de miniature, mais, là plus aucune image ne s'affiche...
Pouvez-vous m'aider SVP? (j'espère que je suis clair dans mes propos)