J'aurais besoin d'un petit coup de main pour parfaire mes connaissances en synthaxe php.
Je suit un tuto pour faire une pagination sur plusieurs pages de mes enregistrements et le tuto me propose la synthaxe suivante pour la boucle
echo '<ul>';
while($item = mysql_fetch_array($resultat)) {
echo "<li>" .$item['titre']. "</li>\n";
}
echo "</ul>\n";
Etant débutant en php j'ai d'abord appris la synthaxe avec un ouvrage apprenant à se servir de dreamweaver 8.C'est pourquoi j'épprouve quelques difficultés à reproduire la synthaxe du tuto sur mon code qui ressemble à:
<table class="tableau" height="110px" width="461px" border="0" cellspacing="0" cellpadding="0" background="Images/annuaire/vignette-annuaire.gif">
<tr>
<td class="photo" rowspan="4" height="97px" width="140px" ><img src="<?php echo $row_rs_camping['url_photo4']; ?>" alt="<?php echo $row_rs_camping['alt_photo1']; ?>"/></td>
<td class="nom" colspan="2" width="315px" height="30px"><a href="camping.php?num_camping=<?php echo $row_rs_camping['id_camping']; ?>"><?php echo $row_rs_camping['nom_etab']; ?></a></td>
</tr>
<tr>
<td width="315px" height="24px" colspan="2"><span class="Style1"><?php echo $row_rs_camping['cp_etab']; ?> <?php echo $row_rs_camping['ville_etab']; ?></span></td>
</tr>
<tr>
<td colspan="2" width="315px" height="18px" valign="top"><span class="Style1"><?php echo $row_rs_camping['date_ouverture']; ?></span></td>
</tr>
<tr>
<td width="150px" height="25px" valign="top"><span class="Style1"><?php echo '<img src="Images/etoile/etoile'.$row_rs_camping['nb_etoile_camping'].'.gif" alt="Camping '.$row_rs_camping['nb_etoile_camping'].' étoiles"></img>'; ?></span></td>
<td class="fiche" width="165px" height="25px" valign="top"><a href="camping.php?num_camping=<?php echo $row_rs_camping['id_camping']; ?>">Fiche complète</a></td>
</tr>
</table>
Je pense qu'il y a sans doute mieux à faire en terme de codification bien que je m'y retrouve.J'aurais donc besoin:
- soit d'un petit cour pour transformer mon code dans une synthaxe approchant celle du tuto que je suis.
- soit reprendre ce que me demande le tuto et m'aider à l'adapter à la synthaxe de mon code.
Si quelqu'un a un peu de temps à perdre à faire progresser un débutant?
Merci d'avance.