par
coulon » 03 janv. 2006, 19:00
bonjour j'ai un petit probleme au niveau de l'affichage lorsque ma query ne retourne rien, j'aimerais afficher un echo("null") à la place de $liste['id_vol']; par exemple: mais que vaut $liste=@pg_fetch_array($result,$i++))
lorsque le
$query="SELECT * FROM vol where id_destination='$id_destination' and date='$date' and first__place_libre>$place"; ne vaut rien parce que mes
first__place_libre<$place";
<tr bgcolor="#00CCFF">
<td width="66"><div align="center">Vol</div></td>
<td width="97"><div align="center">Compagnie</div></td>
<td width="51"><div align="center">Heure</div></td>
<td width="80"><div align="center">Prix First Class </div></td>
<td width="77"><div align="center">prix Classe eco.</div></td>
<td width="93"><div align="center">prix Business Class </div></td>
</tr>
<?$i=0; $_SESSION['f']=0;
while($liste=@pg_fetch_array($result,$i++))
{
if($liste['id_vol']!=FALSE)
{
$_SESSION['f']=1;
}
?>
<tr bgcolor="#CCCCCC" class="Style2">
<td><? if($_SESSION['f']==1) echo $liste['id_vol']; else echo("Null");?> </td>
<td><? if($_SESSION['f']==1) echo $liste['id_compagnie']; else echo("Null"); ?> </td>
<td><? if($_SESSION['f']==1) echo $liste['heure']; ?></td>
<td><? if($_SESSION['f']==1) echo $liste['prix_first_classe']; else echo("Null"); ?> </td>
<td><? if($_SESSION['f']==1) echo $liste['prix_economique']; else echo("Null"); ?></td>
<td><? if($_SESSION['f']==1) echo $liste['prix_business_class']; else echo("Null"); ?> </td>
</tr>
</table>
<form name="form1" method="post" action="option_vente.php">
<p class="Style7">ENTRER LE NUMEROS DU VOL :
<select name="id_vol" size="1" id="id_vol">
<option> </option>
<?php echo("<option value=$liste[id_vol]> $liste[id_vol] </option>");?>
</select>
<input name="submit" type="submit" id="submit" value="Confimer">
</p>
<?}?>
bonjour j'ai un petit probleme au niveau de l'affichage lorsque ma query ne retourne rien, j'aimerais afficher un echo("null") à la place de $liste['id_vol']; par exemple: mais que vaut $liste=@pg_fetch_array($result,$i++))
lorsque le [b]$query="SELECT * FROM vol where id_destination='$id_destination' and date='$date' and first__place_libre>$place"; [/b]ne vaut rien parce que mes [u]first__place_libre<$place"; [/u]
[php]
<tr bgcolor="#00CCFF">
<td width="66"><div align="center">Vol</div></td>
<td width="97"><div align="center">Compagnie</div></td>
<td width="51"><div align="center">Heure</div></td>
<td width="80"><div align="center">Prix First Class </div></td>
<td width="77"><div align="center">prix Classe eco.</div></td>
<td width="93"><div align="center">prix Business Class </div></td>
</tr>
<?$i=0; $_SESSION['f']=0;
while($liste=@pg_fetch_array($result,$i++))
{
if($liste['id_vol']!=FALSE)
{
$_SESSION['f']=1;
}
?>
<tr bgcolor="#CCCCCC" class="Style2">
<td><? if($_SESSION['f']==1) echo $liste['id_vol']; else echo("Null");?> </td>
<td><? if($_SESSION['f']==1) echo $liste['id_compagnie']; else echo("Null"); ?> </td>
<td><? if($_SESSION['f']==1) echo $liste['heure']; ?></td>
<td><? if($_SESSION['f']==1) echo $liste['prix_first_classe']; else echo("Null"); ?> </td>
<td><? if($_SESSION['f']==1) echo $liste['prix_economique']; else echo("Null"); ?></td>
<td><? if($_SESSION['f']==1) echo $liste['prix_business_class']; else echo("Null"); ?> </td>
</tr>
</table>
<form name="form1" method="post" action="option_vente.php">
<p class="Style7">ENTRER LE NUMEROS DU VOL :
<select name="id_vol" size="1" id="id_vol">
<option> </option>
<?php echo("<option value=$liste[id_vol]> $liste[id_vol] </option>");?>
</select>
<input name="submit" type="submit" id="submit" value="Confimer">
</p>
<?}?>[/php]