par
Patriboom » 02 janv. 2008, 05:51
Bah euh ...
il ne suffirait pas de clore ta cellule du tableau 1, puis le rang du tableau 1 après quoi on referme l'accolade puis le tableau 1
bref:
if($_POST['prixmini'] == "40000" and $_POST['prixmaxi'] == "80000") // prix compris entre 40 000 et 80 000€
{
$reponse = mysql_query("SELECT id, type, prix, descriptif, lien, fond FROM bdd WHERE prix >= 40000 AND prix <= 80000 ORDER BY prix"); // Requête SQL
while ($donnees = mysql_fetch_array($reponse) )
{
?>
<tr>
<td colspan="2" style="position:absolute; left:230px; top:200px; z-index:2">
<table width="700" height="300" border="2" cellpadding="0" cellspacing="0" <?php echo '<body background="image page/'.$donnees['fond'].'">'; ?>>
<tr>
<td width="50" height="40">n°</td>
<td width="100" height="40">exclu/agence/vendu</td>
<td width="50" height="40">coup coeur</td>
<td width="50" height="40">réf: <?php echo $donnees['id']; ?></td>
<td width="300" height="40">désignation:<?php echo $donnees['descriptif']; ?></td>
<td width="150" height="40">Prix:<?php echo $donnees['prix']; ?>€</td>
</tr>
<tr>
<td colspan="4"><?php echo '<img src="image/'.$donnees['lien'].'">';?></td>
<td colspan="2"><?php echo $donnees['descriptif']; ?></td>
</tr>
<tr>
<td height="30" colspan="4">En savoir plus</td>
<td height="30" colspan="2"> </td>
</tr>
</table>
</td><td>Autres colonnes</td>
</tr>
<?php } ?>
</table>
J'ignore (mais j'aimerais bien le savoir) ce qu'en pensent les spécialistes, mais si la manipulation du tableau 1 demande plus de souplesse, tu pourrais même envoyer toute tes définitions de tableaux2 dans un variable en Array. Ensuite, lorsque le moment opportun arrive, tu décharge un à un les tableaux 2.
Ou encore, tu planque dans ta définition de tableau 1 une référence à une fonction qui régit la construction d'un tableau2 spécifique du genre:
function tableau2($varibales_necessaires) {
tout ton bataclan ci-haut
}
Code : Tout sélectionner
<table blababla>
<tr>
<td>Première colonne</td>
<td><?php tableau2("MonChoix"); ?> </td>
<td>Troisième colonne</td>
<tr>
</table>
Et salut à mon compatriote Xenon (du Québec)!
Bah euh ...
il ne suffirait pas de clore ta cellule du tableau 1, puis le rang du tableau 1 après quoi on referme l'accolade puis le tableau 1
bref:
[php]
if($_POST['prixmini'] == "40000" and $_POST['prixmaxi'] == "80000") // prix compris entre 40 000 et 80 000€
{
$reponse = mysql_query("SELECT id, type, prix, descriptif, lien, fond FROM bdd WHERE prix >= 40000 AND prix <= 80000 ORDER BY prix"); // Requête SQL
while ($donnees = mysql_fetch_array($reponse) )
{
?>
<tr>
<td colspan="2" style="position:absolute; left:230px; top:200px; z-index:2">
<table width="700" height="300" border="2" cellpadding="0" cellspacing="0" <?php echo '<body background="image page/'.$donnees['fond'].'">'; ?>>
<tr>
<td width="50" height="40">n°</td>
<td width="100" height="40">exclu/agence/vendu</td>
<td width="50" height="40">coup coeur</td>
<td width="50" height="40">réf: <?php echo $donnees['id']; ?></td>
<td width="300" height="40">désignation:<?php echo $donnees['descriptif']; ?></td>
<td width="150" height="40">Prix:<?php echo $donnees['prix']; ?>€</td>
</tr>
<tr>
<td colspan="4"><?php echo '<img src="image/'.$donnees['lien'].'">';?></td>
<td colspan="2"><?php echo $donnees['descriptif']; ?></td>
</tr>
<tr>
<td height="30" colspan="4">En savoir plus</td>
<td height="30" colspan="2"> </td>
</tr>
</table>
</td><td>Autres colonnes</td>
</tr>
<?php } ?>
</table>
[/php]
J'ignore (mais j'aimerais bien le savoir) ce qu'en pensent les spécialistes, mais si la manipulation du tableau 1 demande plus de souplesse, tu pourrais même envoyer toute tes définitions de tableaux2 dans un variable en Array. Ensuite, lorsque le moment opportun arrive, tu décharge un à un les tableaux 2.
Ou encore, tu planque dans ta définition de tableau 1 une référence à une fonction qui régit la construction d'un tableau2 spécifique du genre:
[php]
function tableau2($varibales_necessaires) {
tout ton bataclan ci-haut
}
[/php]
[code]
<table blababla>
<tr>
<td>Première colonne</td>
<td><?php tableau2("MonChoix"); ?> </td>
<td>Troisième colonne</td>
<tr>
</table>
[/code]
Et salut à mon compatriote Xenon (du Québec)!