par
yaug » 11 mars 2009, 14:53
Bonjour.
En fait ... tout dépend de ce que tu considère comme une marque connue.
Voici ce que je te propose
<?php
$string_top_options = "";
$string_other_options = "";
mysql_select_db($database_SAGIP, $SAGIP);
$sqldip = 'SELECT * from tb_compagnies';
if ($resselectdip = mysql_query($sqldip)) {
while ($selectdip = mysql_fetch_array($resselectdip))
{
//On détermine si l'option est sélectionnée
if ($id_util == $selectdip["id_user"])
$temp = "selected";
else
$temp = "";
//On détermine si c'est une marque connue
if($selectdip['connue'] == 1)
$string_top_options .= '<option value="'.$selectdip["id_compagnie"].'"'.$temp.'>'.$selectdip["nom"].' - '.$selectdip["code_courtier"].'</option>';
else
$string_other_options .= '<option value="'.$selectdip["id_compagnie"].'"'.$temp.'>'.$selectdip["nom"].' - '.$selectdip["code_courtier"].'</option>';
}
}
?>
<select name="compagnie" class="champ" id="compagnie">
<option value="0">Aucun</option>
<?php
echo $string_top_options;
echo $string_other_options;
?>
</select>
En gros, tu rajoutes dans ta table un champ 'marque_connue' (ou ce que tu veux), de type enum que tu met à 1 ou 0.
Cela te conviens ?
Bonjour.
En fait ... tout dépend de ce que tu considère comme une marque connue.
Voici ce que je te propose
[php]
<?php
$string_top_options = "";
$string_other_options = "";
mysql_select_db($database_SAGIP, $SAGIP);
$sqldip = 'SELECT * from tb_compagnies';
if ($resselectdip = mysql_query($sqldip)) {
while ($selectdip = mysql_fetch_array($resselectdip))
{
//On détermine si l'option est sélectionnée
if ($id_util == $selectdip["id_user"])
$temp = "selected";
else
$temp = "";
//On détermine si c'est une marque connue
if($selectdip['connue'] == 1)
$string_top_options .= '<option value="'.$selectdip["id_compagnie"].'"'.$temp.'>'.$selectdip["nom"].' - '.$selectdip["code_courtier"].'</option>';
else
$string_other_options .= '<option value="'.$selectdip["id_compagnie"].'"'.$temp.'>'.$selectdip["nom"].' - '.$selectdip["code_courtier"].'</option>';
}
}
?>
<select name="compagnie" class="champ" id="compagnie">
<option value="0">Aucun</option>
<?php
echo $string_top_options;
echo $string_other_options;
?>
</select>
[/php]
En gros, tu rajoutes dans ta table un champ 'marque_connue' (ou ce que tu veux), de type enum que tu met à 1 ou 0.
Cela te conviens ?