affiger image d'une bdd avec php
bon voila je vien de faire un script pour affiché les image il marcher tres bien jusqua que je rajoute les valeurs en $_POST.
si quelqu'un peu m'aidé à me dire se qui ne va pas merci :)
voici le code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| include 'info.php';
$int=$_POST['ans'];
$conex=mysql_connect($host,$user,$mdp);
mysql_select_db($nombdd,$conex);
$requete="select id_im,nom_im from image where année='$int'";
$requete1="select id_im,url from image where année='$int'";
$requete2="select count(*) from image where année='$int'";
$noIM=mysql_query($requete);
$url=mysql_query($requete1);
$nbIM=mysql_query($requete2);
$i=0;
$nb=mysql_fetch_array($nbIM);
while($nomIM = mysql_fetch_array($noIM)){
$tabIM[$i]=$nomIM[1];
$i++;
}
$i=0;
while($urlIM = mysql_fetch_array($url)){
$tabURL[$i]=$urlIM[1];
$i++;
$ad="Fonctionphp/fctMAJ/";
}
for($i=0;$i<$nb[0];$i++)
{
$afIM=$ad.$tabURL[$i].$tabIM[$i];
echo "<img src='$afIM'/></br>";
} |