par
Invité » 10 mai 2005, 16:20
non, c pas ca, mais j'ai eparnier tout ce code car je pensait que le problème venai de la requete sql, et pas du php.
Code : Tout sélectionner
<html>
<body>
<center><h2>Rédiger une notes de syntheses</h2></center><br><br>
<A HREF="index.php"> retour a l\'index </A><br><br>
<?php
$bdd = "synthese";
$host = "localhost";
$user = "renatane";
$pass = "esteban";
mysql_connect($host, $user, $pass)
or die("Connexion à la base impossible");
mysql_select_db("$bdd")
or die("Ouverture base impossible");
$rq = "SELECT DISTINCT nom_service FROM service ORDER BY nom_service";
$result = mysql_query($rq)
or die ("Exécution de la requête service impossible");
//DISTINCT permet d'afficher qu'une fois les données
echo "<form action='enregistrer.php' method='post'>
Service :
<select name='nom_service'>\n<br>";
while ($liste=mysql_fetch_array($result))
{
extract($liste);
echo "<option value='$nom_service'>$nom_service\n";
}
echo " </select>\n";
echo "<br><br>";
echo " Titre :";
echo "<INPUT type=text name='titre' SIZE='60' MAXLENGTH='200'><BR>\n";
echo "<br> ";
echo " Article :<BR><br>";
echo " <TEXTAREA name='article' cols='100' rows='10' height=100% width=100% WRAP=virtual>";
echo " </TEXTAREA>";
echo "<table cols='2' rows='2' border='0' width=100% > ";
echo " <tr><td>";
$rq = "SELECT DISTINCT instance.jour, instance.mois, instance.annee FROM instance ORDER BY id_instance";
$result = mysql_query($rq)
or die ("Exécution de la requête instance impossible");
//DISTINCT permet d'afficher qu'une fois les données
echo " Proposé pour l instance du:
<select name='date'>\n<br>";
while ($list=mysql_fetch_array($result))
{
extract($list);
$date=$list['jour']." ".$list['mois']." ".$list['annee'];
echo "<option value='$date'>$date</option>\n";
}
echo " </select>\n";
echo "<br><br>";
$nature="SELECT DISTINCT instance.type
FROM instance
where instance.jour=". $list['jour'] ."
and instance.mois=". $list['mois'] ."
and instance.annee= ". $list['annee'];
echo "Nature : $nature ";
echo "<br>";
echo "Date limite de remise des dossiers : <br><br> ";
echo "</td> ";
echo "<td>Destinataire : <INPUT TYPE=text NAME='destinataire' SIZE='30' MAXLENGTH='50'><A HREF='annuaire.php'> consulter
l annuaire </A><br><BR> ";
mysql_close();
echo "</td> ";
echo "</tr> ";
echo " <tr colspan='2'><td>";
echo " <INPUT TYPE='button' name= 'valider' VALUE='Valider' OnClick='window.open('confirmation.php','pop1','height=200, width=400, top=100, left=100,toolbar=no, menubar=yes, location=no, resizable=yes, scrollbars=no, status=no');'>";
echo "<INPUT TYPE='submit' name ='enregistrer' VALUE='Enregistrer'> ";
echo "<INPUT TYPE='reset' VALUE='Annuler'></td></tr> ";
echo "<br><br><br>";
echo"</table></form>";
?>
</body>
</html>
non, c pas ca, mais j'ai eparnier tout ce code car je pensait que le problème venai de la requete sql, et pas du php.
[code]<html>
<body>
<center><h2>Rédiger une notes de syntheses</h2></center><br><br>
<A HREF="index.php"> retour a l\'index </A><br><br>
<?php
$bdd = "synthese";
$host = "localhost";
$user = "renatane";
$pass = "esteban";
mysql_connect($host, $user, $pass)
or die("Connexion à la base impossible");
mysql_select_db("$bdd")
or die("Ouverture base impossible");
$rq = "SELECT DISTINCT nom_service FROM service ORDER BY nom_service";
$result = mysql_query($rq)
or die ("Exécution de la requête service impossible");
//DISTINCT permet d'afficher qu'une fois les données
echo "<form action='enregistrer.php' method='post'>
Service :
<select name='nom_service'>\n<br>";
while ($liste=mysql_fetch_array($result))
{
extract($liste);
echo "<option value='$nom_service'>$nom_service\n";
}
echo " </select>\n";
echo "<br><br>";
echo " Titre :";
echo "<INPUT type=text name='titre' SIZE='60' MAXLENGTH='200'><BR>\n";
echo "<br> ";
echo " Article :<BR><br>";
echo " <TEXTAREA name='article' cols='100' rows='10' height=100% width=100% WRAP=virtual>";
echo " </TEXTAREA>";
echo "<table cols='2' rows='2' border='0' width=100% > ";
echo " <tr><td>";
$rq = "SELECT DISTINCT instance.jour, instance.mois, instance.annee FROM instance ORDER BY id_instance";
$result = mysql_query($rq)
or die ("Exécution de la requête instance impossible");
//DISTINCT permet d'afficher qu'une fois les données
echo " Proposé pour l instance du:
<select name='date'>\n<br>";
while ($list=mysql_fetch_array($result))
{
extract($list);
$date=$list['jour']." ".$list['mois']." ".$list['annee'];
echo "<option value='$date'>$date</option>\n";
}
echo " </select>\n";
echo "<br><br>";
$nature="SELECT DISTINCT instance.type
FROM instance
where instance.jour=". $list['jour'] ."
and instance.mois=". $list['mois'] ."
and instance.annee= ". $list['annee'];
echo "Nature : $nature ";
echo "<br>";
echo "Date limite de remise des dossiers : <br><br> ";
echo "</td> ";
echo "<td>Destinataire : <INPUT TYPE=text NAME='destinataire' SIZE='30' MAXLENGTH='50'><A HREF='annuaire.php'> consulter
l annuaire </A><br><BR> ";
mysql_close();
echo "</td> ";
echo "</tr> ";
echo " <tr colspan='2'><td>";
echo " <INPUT TYPE='button' name= 'valider' VALUE='Valider' OnClick='window.open('confirmation.php','pop1','height=200, width=400, top=100, left=100,toolbar=no, menubar=yes, location=no, resizable=yes, scrollbars=no, status=no');'>";
echo "<INPUT TYPE='submit' name ='enregistrer' VALUE='Enregistrer'> ";
echo "<INPUT TYPE='reset' VALUE='Annuler'></td></tr> ";
echo "<br><br><br>";
echo"</table></form>";
?>
</body>
</html>[/code]