j'ai une page qui affiche des images au hasard sélectionnée dans une base de données mysql
une partie du style de la page aussi est pris dans une table
voici mon code
<?
mysql_connect('sql.free.fr','xxx','xxx');
mysql_select_db('yuu_sw');
mysql_fetch_assoc(mysql_query("SELECT ban_id, user_id, ban_fond, ban_color, ban_color2, ban_credits, ban_affichage FROM a_ban WHERE ban_id='$frame_id'"));
$id1 = $resultats['ban_id'];
$id2 = $resultats['user_id'];
$fond = $resultats['ban_fond'];
$color = $resultats['ban_color'];
$color2 = $resultats['ban_color2'];
$credits1 = $resultats['ban_credits'];
$affiche = $resultats['ban_affichage'];
mysql_close();
?>
<?
mysql_connect('sql.free.fr','xxx','xxx');
mysql_select_db('yuu_sw');
$init = mysql_query("DELETE FROM a_ban_active");
$init2 = mysql_query("ALTER TABLE a_ban_active AUTO_INCREMENT=0");
$active = mysql_query("SELECT ban_id, user_id FROM a_ban WHERE ban_credits>0 AND ban_id!=$frame_id");
while($insert = mysql_fetch_assoc($active))
{
$sql="INSERT INTO a_ban_active VALUES('',".$insert['user_id'].",".$insert['ban_id'].")";
mysql_query($sql);
}
mysql_close();
?>
<?
mysql_connect('sql.free.fr','xxx','xxx');
mysql_select_db('yuu_sw');
$compter = mysql_num_rows(mysql_query("SELECT active_id FROM a_ban_active"));
$nombre = $compter;
$rand = mt_rand(0,$nombre);
$resultat_active = mysql_fetch_assoc(mysql_query("SELECT ban_id FROM a_ban_active WHERE active_id='$rand'"));
$ban_id_active = '$resultat_active';
$emp = mysql_fetch_assoc(mysql_query("SELECT ban_id, ban_emp, ban_lien, ban_credits, ban_affiche FROM a_ban WHERE ban_id='$ban_id_active'"));
$id3 = $emp['ban_id'];
$ban_emp = $emp['ban_emp'];
$ban_lien = $emp['ban_lien'];
$credits2 = $emp['ban_credits'];
$affiche = $emp['ban_affiche'];
mysql_close();
?>
<?
$new_credits1 = $credits1+1;
$new_credits2 = $credits2-1;
$new_affichage = $affichage+1;
$new_affiche = $affiche+1;
mysql_connect('sql.free.fr','xxx','xxx');
mysql_select_db('yuu_sw');
mysql_query("UPDATE a_ban SET ban_credits='$new_credits1' WHERE ban_id='$id1'");
mysql_query("UPDATE a_ban SET ban_credits='$new_credits2' WHERE ban_id='$id3'");
mysql_query("UPDATE a_ban SET ban_affiche='$new_affiche' WHERE ban_id='$id3'");
mysql_query("UPDATE a_ban SET ban_affichage='$new_affichage' WHERE ban_id='$id1'");
mysql_close();
?>
<STYLE TYPE=text/css>
A.menulink {
font-family:Verdana;
font-size:10px;
color: #<? echo "$color"; ?>
text-decoration: none;
}
.texte { font-family: Verdana; font-size: 10 px }
A.menulink:hover {
color: #<? echo "$color2"; ?>
font-style: bold;
text-decoration: none;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</STYLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<table width="468" height="90" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="60"><a href="<? echo $ban_lien; ?>" target="_blank"><img src="<? echo $ban_emp; ?>" width="468" height="60" border="0" align="absbottom"></a></td>
</tr>
<tr>
<td height="27" align="center" valign="middle"><a href="http://www.banniere-echange.fr.tc" target="_blank" class="menulink"><strong>Bannière-echange.fr.tc, service gratuit d'échange de bannières ratio 1:1, rentabilisez votre site en augmentant le nombre de visiteurs, publicité gratuite </strong></a></td>
</tr>
</table>
sa ne me met aucune erreur du genre unexpected machin ...mais sa n'affiche rien du tout, à la place de l'image, il y a une croix ... sa n'actualise pas le nombre d'affichages ...
qu'est ce qui ne vas pas ???