Salut la communauté !
J'ai un petit souci avec une insertion, j'ai créer un formulaire d'insertion, et un autre où je fais appel à une procédure stockée pour me permettre d'inserer. Je ne vois pas d'erreur dans le code, je vous le soumet pour analyse
page synthese.php:
<?php require_once('../Connections/gesco1.php'); ?>
<?php
mysql_select_db($database_gesco1, $gesco1);
$query_Rsname_cat = "SELECT categorie.NOM_CATEGORIE FROM categorie";
$Rsname_cat = mysql_query($query_Rsname_cat, $gesco1) or die(mysql_error());
$row_Rsname_cat = mysql_fetch_assoc($Rsname_cat);
$totalRows_Rsname_cat = mysql_num_rows($Rsname_cat);
mysql_select_db($database_gesco1, $gesco1);
$query_RsUnite = "SELECT unite.NOM_UNITE FROM unite";
$RsUnite = mysql_query($query_RsUnite, $gesco1) or die(mysql_error());
$row_RsUnite = mysql_fetch_assoc($RsUnite);
$totalRows_RsUnite = mysql_num_rows($RsUnite);
mysql_select_db($database_gesco1, $gesco1);
$query_RsSit = "SELECT situation.N_SITUATION FROM situation";
$RsSit = mysql_query($query_RsSit, $gesco1) or die(mysql_error());
$row_RsSit = mysql_fetch_assoc($RsSit);
$totalRows_RsSit = mysql_num_rows($RsSit);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Page d'accueil</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../css/mm_spa.css" type="text/css" />
<style type="text/css">
<!--
.Style2 {color: #FFFFFF}
.Style5 {
color: #1700AB;
font-weight: bold;
font-size: 16px;
font-style: italic;
}
.Style9 {font-size: 14px}
.Style10 {
color: #FF0000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
}
.Style12 {color: #0000FF; font-size: 10px; font-weight: bold; }
.Style17 { font-size: 36px;
font-weight: bold;
font-family: Algerian;
color: #9900FF;
}
.Style18 {
font-family: Algerian;
color: #9900FF;
}
.Style13 {color: #0000FF}
-->
#menu-gesco, #menu-gesco ul{
padding:0;
margin:0;
list-style:none;
text-align:center;
}
#menu-gesco li{
display:inline-block;
position:relative;
border-radius:7px 7px 0 0;
}
#menu-gesco ul li{
display:inherit;
border-radius:0;
}
#menu-gesco ul li:hover{
border-radius:0;
}
#menu-gesco ul li:last-child{
border-radius:0 0 7px 7px;
}
#menu-gesco ul{
position:absolute;
max-height:0;
left: 0;
right: 0;
overflow:hidden;
-moz-transition: .8s all .3s;
-webkit-transition: .8s all .3s;
transition: .8s all .3s;
}
#menu-gesco li:hover ul{
max-height:35em;
}
/* background des liens menus */
#menu-gesco li:first-child{
background-color: #3399FF;
background-image:-webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
#menu-gesco li:nth-child(2){
background-color: #3399FF;
background-image: -webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
#menu-gesco li:nth-child(3){
background-color: #3399FF;
background-image:-webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
#menu-gesco li:nth-child(4){
background-color: #3399FF;
background-image:-webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
#menu-gesco li:nth-child(5){
background-color: #3399FF;
background-image:-webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
#menu-gesco li:nth-child(6){
background-color: #3399FF;
background-image:-webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
#menu-gesco li:nth-child(7){
background-color: #3399FF;
background-image:-webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
#menu-gesco li:last-child{
background-color: #3399FF;
background-image:-webkit-linear-gradient(top, #3399FF 0%, #3399FF 100%);
background-image:linear-gradient(to bottom, #3399FF 0%, #3399FF 100%);
}
/* background des liens sous menus */
#menu-gesco li:first-child li{
background:#3399FF;
}
#menu-gesco li:nth-child(2) li{
background:#3399FF;
}
#menu-gesco li:nth-child(3) li{
background:#3399FF;
}
#menu-gesco li:nth-child(4) li{
background:#3399FF;
}
#menu-gesco li:nth-child(5) li{
background:#3399FF;
}
#menu-gesco li:nth-child(6) li{
background:#3399FF;
}
#menu-gesco li:nth-child(7) li{
background:#3399FF;
}
#menu-gesco li:last-child li{
background:#3399FF;
}
/* background des liens menus et sous menus au survol */
#menu-gesco li:first-child:hover, #menu-gesco li:first-child li:hover{
background:#3399FF;
}
#menu-gesco li:nth-child(2):hover, #menu-gesco li:nth-child(2) li:hover{
background:#3399FF;
}
#menu-gesco li:nth-child(3):hover, #menu-gesco li:nth-child(3) li:hover{
background:#3399FF;
}
#menu-gesco li:nth-child(4):hover, #menu-gesco li:nth-child(4) li:hover{
background:#3399FF;
}
#menu-gesco li:nth-child(5):hover, #menu-gesco li:nth-child(5) li:hover{
background:#3399FF;
}
#menu-gesco li:nth-child(6):hover, #menu-gesco li:nth-child(6) li:hover{
background:#3399FF;
}
#menu-gesco li:nth-child(7):hover, #menu-gesco li:nth-child(7) li:hover{
background:#3399FF;
}
#menu-gesco li:last-child:hover, #menu-gesco li:last-child li:hover{
background:#3399FF;
}
/* les a href */
#menu-gesco a{
text-decoration:none;
display:block;
padding:10px 60px;
color:#fff;
font-family:arial;
}
#menu-gesco ul a{
padding:8px 0;
}
#menu-gesco li:hover li a{
color:#fff;
text-transform:inherit;
}
#menu-gesco li:hover a, #menu-gesco li li:hover a{
color:#000;
}
.Style19 {color: #000000}
body,td,th {
color: #000000;
}
body {
background-color: #FFFFFF;
}
.Style20 {
font-size: 20px;
color: #000000;
}
</style>
</head>
<body background="../images/mm_bg_red.gif">
<table height="700" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr bgcolor="#220103">
<td colspan="2" rowspan="2" nowrap="nowrap" bgcolor="#55FFFF"><img src="../images/logo police.png" alt="Header image" width="215" height="191" border="0" /></td>
<td height="55" colspan="2" valign="bottom" nowrap="nowrap" bgcolor="#55FFFF" id="logo"><div align="center">
<p align="center"><span class="Style17">GESCO V1.0</span></p>
<p align="center" class="Style18">Gestion de la Main courante et du Fichier des Délinquants</p>
<h1> </h1>
</div></td>
<td width="201" rowspan="2" bgcolor="#55FFFF"> </td>
<td width="13" rowspan="2"> </td>
</tr>
<tr bgcolor="#220103">
<td height="48" colspan="2" valign="top" nowrap="nowrap" bgcolor="#55FFFF" id="tagline"><div align="center" class="Style2">
<p> </p>
<p class="Style12">Force - Efficacité - Discipline </p>
</div></td>
</tr>
<tr bgcolor="#FF9900">
<td height="2" colspan="6" bgcolor="#00CCFF"><img src="../images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr bgcolor="#FF080E">
<td colspan="6"><img src="../images/mm_spacer.gif" alt="" width="1" height="2" border="0" /></td>
</tr>
<tr bgcolor="#FF9900">
<td colspan="6"><img src="../images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr bgcolor="#FF080E">
<td colspan="6" bgcolor="#55FFFF"><img src="../images/mm_spacer.gif" alt="" width="1" height="18" border="0" />
<ul id="menu-gesco">
<li>
<a href="Accueil_admin.php">Accueil</a> </li>
<li><a href="journal.php">Journal</a> </li>
<li><a href="users.php">Utilisateurs</a> </li>
<li>
<a href="Accueil_admin.php">Création</a>
<ul><li><a href="ccp.php">CCP</a></li>
<li><a href="cpa.php">CPA</a></li>
<li><a href="cpq.php">CPQ</a></li>
<li><a href="service.php">Service</a></li>
<li><a href="Serviceconfig.php">Changer de Service</a></li>
<li><a href="plainte.php">Plainte</a></li>
</ul>
</li>
<li><a href="Accueil_admin.php"> Commissariarriats</a>
<ul><li><a href="CCPconfiguration.php">Commissariats Centraux de Police</a></li>
<li><a href="CPAconfiguration.php">Commissariats de Police d'Arrondissements</a></li>
<li><a href="CPQconfiguration.php">Commissariats de Police de Quartiers</a></li>
<li><a href="ouverture_registre.php">Ouverture du Régistre</a></li>
<li><a href="configurationregistre.php">Clôturer ou Modifier le Régistre
</a></li>
</ul>
</li>
<li><a href="Accueil_admin.php">Gestion Base des données</a>
<ul><li><a href="backup.php">Sauvegarder la Base de données</a></li>
<li><a href="restaure.php">Restaurer la Base de données</a></li>
</ul>
</li>
<li><a href="../deconnexion.php">Déconnexion</a></li>
</ul></td>
</tr>
<tr bgcolor="#FF9900">
<td colspan="6"><img src="../images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr bgcolor="#FF080E">
<td colspan="6"><img src="../images/mm_spacer.gif" alt="" width="1" height="2" border="0" /></td>
</tr>
<tr bgcolor="#FF9900">
<td colspan="6" bgcolor="#00CCFF"><img src="../images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr>
<td width="165" valign="top" id="navborder"><table width="212" height="87" border="0">
<tr>
<td width="213" height="83"> </td>
</tr>
</table>
<br /></td>
<td width="50"><img src="../images/mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
<td width="837" valign="top"><img src="../images/mm_spacer.gif" alt="" width="305" height="1" border="0" /><br />
<br />
<br />
<form name="form1_insertsynthese" action="insert_synthese.php" method="POST">
<table width="694" height="516" border="1" align="center" cellpadding="2" cellspacing="2">
<tr align="center">
<td width="463">N_Situation</td>
<td width="211"><select name="Select1">
<option value="" <?php if (!(strcmp("", "---choisir---"))) {echo "selected=\"selected\"";} ?>>------Choisir N° Situation------</option>
<?php
do {
?>
<option value="<?php echo $row_RsSit['N_SITUATION']?>"<?php if (!(strcmp($row_RsSit['N_SITUATION'],"---choisir Num_Sit---"))) {echo "selected=\"selected\"";} ?>><?php echo $row_RsSit['N_SITUATION']?></option>
<?php
} while ($row_RsSit = mysql_fetch_assoc($RsSit));
$rows = mysql_num_rows($RsSit);
if($rows > 0) {
mysql_data_seek($RsSit, 0);
$row_RsSit = mysql_fetch_assoc($RsSit);
}
?>
</select></td>
</tr>
<tr align="center">
<td>NOM_UNITE</td>
<td><select name="Select2">
<option value="" <?php if (!(strcmp("", "---choisir---"))) {echo "selected=\"selected\"";} ?>>------Choisir Unité------</option>
<?php
do {
?>
<option value="<?php echo $row_RsUnite['NOM_UNITE']?>"<?php if (!(strcmp($row_RsUnite['NOM_UNITE'], "---choisir Uni---"))) {echo "selected=\"selected\"";} ?>><?php echo $row_RsUnite['NOM_UNITE']?></option>
<?php
} while ($row_RsUnite = mysql_fetch_assoc($RsUnite));
$rows = mysql_num_rows($RsUnite);
if($rows > 0) {
mysql_data_seek($RsUnite, 0);
$row_RsUnite = mysql_fetch_assoc($RsUnite);
}
?>
</select>
</td>
</tr>
<tr align="center">
<td>NOM_CATEGORIE</td>
<td><select name="Select3">
<option value="" <?php if (!(strcmp("", "---choisir---"))) {echo "selected=\"selected\"";} ?>>------Choisir une Categorie------</option>
<?php
do {
?>
<option value="<?php echo $row_Rsname_cat['NOM_CATEGORIE']?>"<?php if (!(strcmp($row_Rsname_cat['NOM_CATEGORIE'],"---choisir Cat---"))) {echo "selected=\"selected\"";} ?>><?php echo $row_Rsname_cat['NOM_CATEGORIE']?></option>
<?php
} while ($row_Rsname_cat = mysql_fetch_assoc($Rsname_cat));
$rows = mysql_num_rows($Rsname_cat);
if($rows > 0) {
mysql_data_seek($Rsname_cat, 0);
$row_Rsname_cat = mysql_fetch_assoc($Rsname_cat);
}
?>
</select>
</td>
</tr>
<tr align="center">
<td>THEORIQUE</td>
<td><input type="text" name="texttheo" size=14></td>
</tr>
<tr align="center">
<td>REALISE</td>
<td><input type="text" name="textreal" size=14></td>
</tr>
<tr align="center">
<td>PRESENT</td>
<td><input type="text" name="textpres" size=14></td>
</tr>
<tr align="center">
<td>ABSENT</td>
<td><input type="text" name="textabs" size=14></td>
</tr>
<tr align="center">
<td>DESSERTEUR</td>
<td><input type="text" name="textdess" size=14></td>
</tr>
<tr align="center">
<td>SERVICE</td>
<td><input type="text" name="textserv" size=14></td>
</tr>
<tr align="center">
<td>PERMISSION</td>
<td><input type="text" name="textperm" size=14></td>
</tr>
<tr align="center">
<td>MALADE</td>
<td><input type="text" name="textmal" size=14></td>
</tr>
<tr align="center">
<td>REPOS</td>
<td><input type="text" name="textrep" size=14></td>
</tr>
<tr align="center">
<td>STAGE</td>
<td><input type="text" name="textstag" size=14></td>
</tr>
<tr align="center">
<td>PRISON</td>
<td><input type="text" name="textpris" size=14></td>
</tr>
<tr align="center">
<td>CONGE</td>
<td><input type="text" name="textcong" size=14></td>
</tr>
<tr align="center">
<td>MISSION</td>
<td><input type="text" name="textmiss" size=14></td>
</tr>
<tr align="center">
<tr align="center">
<td colspan="2"><input type="submit" value="Faire la Synthèse"></td>
</tr>
</table>
</form>
<p align="center"> </p>
<p> <br />
<br />
</p></td>
<td width="50"><img src="mm_spacer.gif" alt="" width="50" height="1" border="0" /></td>
<td width="4" valign="top"><br /></td><td width="4"> </td>
</tr>
<tr>
<td width="18"> </td>
<td width="197"> </td>
<td width="1000"><table width="1000" height="15" border="0">
<tr>
<td width="1595" height="14"><div align="center" class="Style9">
<div align="left"><span class="Style10">-----------------------------------------------------Copyright (c) 2015-2025 by ARPCE - Système d'Information (SI)DGDA&MA -------------------------------------</span><span class="Style10">----------------</span></div>
</div></td>
</tr>
</table></td>
<td width="50"> </td>
<td width="4"> </td>
<td width="4"> </td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Rsname_cat);
mysql_free_result($RsUnite);
mysql_free_result($RsSit);
?>
page insert_synthese*********
<?php
//connection au serveur et à la bd
$cnx = mysql_connect( "localhost", "root", "" ) ;
$db = mysql_select_db( "gesma" ) ;
//déclaration des variables
$N_SITUAT =$_POST['Select1'];
$NOM_UNITE =$_POST['Select2'];
$NOM_CATEGORIE =$_POST['Select3'];
$THEORIQUE =$_POST['texttheo'];
$REALISE =$_POST['textreal'];
$PRESENT =$_POST['textpres'];
$ABSENT =$_POST['textabs'];
$DESSERTEUR =$_POST['textdess'];
$SERVICE =$_POST['textserv'];
$PERMISSION =$_POST['textperm'];
$MALADE =$_POST['textmal'];
$REPOS =$_POST['textrep'];
$STAGE =$_POST['textstag'];
$PRISON =$_POST['textpris'];
$CONGE =$_POST['textcong'];
$MISSION =$_POST['textmiss'];
//Exécution de la procédure stockée
$resultat = mysql_query("Call INSERT_SYNTHESE('$N_SITUAT','$NOM_UNITE','$NOM_CATEGORIE','$THEORIQUE','$REALISE',
'$PRESENT','$ABSENT','$DESSERTEUR','$SERVICE','$PERMISSION','$MALADE','$REPOS','$STAGE','$PRISON','$CONGE','$MISSION')");
//affichage des résultats, pour savoir si l'insertion a marchée
if($resultat)
{
echo ("Synthèse effectuée") ;
}
else
{
echo("La Synthèse a échouée") ;
}
//Ferméture
mysql_close();
?>
Afficher la suite