Modifier un script
Posté : 21 oct. 2005, 11:08
Bonjour
J'ai un petit script qui me permet d'afficher dans une page une image, un texte et une url provenant d'une BDD.
Ca affiche ces infos par rapport à l'id_article de la page en cours:
Pour info #ID_ARTICLE est spécifique à SPIP. Puis j'affiche :
Ca ne fonctionne qu'avec un enregistrement provenant de la base.
Maintenant je voudrais avoir la possibilité d'afficher plusieurs enregistrements si ils ont tous le même id_article.
Comment faire ? Je débute en php
Merci pour votre aide
Philippe
J'ai un petit script qui me permet d'afficher dans une page une image, un texte et une url provenant d'une BDD.
Ca affiche ces infos par rapport à l'id_article de la page en cours:
Code : Tout sélectionner
// ON RECUPERE LES DONNEES CORRESPONDANTES A L'UTILISATEUR LOGE
$select_db=@mysql_select_db($sql_bdd);
if($select_db){
$result = mysql_query("SELECT * FROM affiliation WHERE id_article=#ID_ARTICLE",$db_link) or die(mysql_error());
if (mysql_num_rows($result) == 0) {
echo " ";
}else{
$row = mysql_fetch_assoc($result);?>Code : Tout sélectionner
<tr>
<td width="60" rowspan="2"><a target="blank" href="<?echo $row['url1'];?>"><img src="IMG/<?echo $row['image'];?>" width="60" height="55" border="0"></a></td>
<td width="2"><img src="IMG/pixel_transparent.gif" width="2" height="2"></td>
<td width="116" class="textegrastitre"><?echo $row['artiste'];?> - <?echo $row['titre'];?></td>
</tr>Maintenant je voudrais avoir la possibilité d'afficher plusieurs enregistrements si ils ont tous le même id_article.
Comment faire ? Je débute en php
Merci pour votre aide
Philippe