j'ai realisé une base admin, il n'y a pas d'erreur qui s'affiche mais quand je veux modifier ou créer une nouvelle prestation rien ne se passe.
j'ai deux pages sous mssql/php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
<?php
$connexion = mssql_connect("","","");
		if ($connexion)
		{
			mssql_select_db("",$connexion);
if (isset($_GET['modifierprestation'])) // Si on demande de modifier une news
 
{
    // On protège la variable "modifier_news" pour éviter une faille SQL
 
 
$_GET['modifierprestation'] =    htmlspecialchars(str_replace("'","''",$_GET['modifierprestation']));
 
 
	$requete="SELECT n.noprestation, nomprestation, libtype, nommodule, n.numintervenant, numprojet FROM prestation pr, intervenant i, necessiter n WHERE  n.numintervenant=i.numintervenant and n.noprestation=pr.noprestation and n.noprestation='" . $_GET['modifierprestation'] . "'";
    $resultat=mssql_query($requete,$connexion);
	    $ligne=mssql_fetch_array($resultat); 
 
 
    // On place le titre et le contenu dans des variables simples
 
 
    $nomprestation = stripslashes($ligne['nomprestation']);
	$libtype = stripslashes($ligne['libtype']);
	$nommodule = stripslashes($ligne['nommodule']);
	$numintervenant=stripslashes($ligne['numintervenant']);
	$numprojet = stripslashes($ligne['numprojet']);
 
    $noprestation = $ligne['noprestation']; // Cette variable va servir pour se souvenir que c'est une modification
}
else // C'est qu'on rédige une nouvelle news
{
 
 
    $nomprestation = '';
	$libtype = '';
	$nommodule = '';
	$numintervenant = '';
	$numprojet = '';
 
    $noprestation = 0; // La variable vaut 0, donc on se souviendra que ce n'est pas une modification
}
}
?>
<form action=".php" method="post">
 
<p align="center">nomprestation : <p align="center"><input type="text" size="30" name="nompre" value="<?php echo $nomprestation; ?>" /></p></p>
<p align="center">libtype : <p align="center"><input type="text" size="30" name="lib" value="<?php echo $libtype; ?>" /></p></p>
<p align="center">nommodule : <p align="center"><input type="text" size="30" name="nommod" value="<?php echo $nommodule; ?>" /></p></p>
<p align="center">numintervenant : <p align="center"><input type="text" size="30" name="nommod" value="<?php echo $numintervenant; ?>" /></p></p>
<p align="center">numprojet : <p align="center"><input type="text" size="30" name="numpro" value="<?php echo $numprojet; ?>" /></p></p>
 
<p align="center">
    <input type="hidden" name="noprestation" value="<?php echo $noprestation; ?>" />
    <input type="submit" value="Envoyer" /></p>
</p>
</form>
 
 
 
</div>

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 
<h2><a href=".php">Ajouter une prestation</a></h2>
<?php
 
 
$connexion = mssql_connect("","","");
		if ($connexion)
		{
			mssql_select_db("",$connexion);
 
//-----------------------------------------------------
// Vérification 1 : est-ce qu'on veut poster une news ?
//-----------------------------------------------------
if (isset($_POST['nomprestation']) AND isset($_POST['libtype']) AND isset($_POST['nommodule']) AND isset($_POST['numintervenant']) AND isset($_POST['numprojet']))
{
 
    $nomprestation = addslashes($_POST['nomprestation']);
	$libtype = addslashes($_POST['libtype']);
	$nommodule = addslashes($_POST['nommodule']);
	$numintervenant = addslashes($_POST['numintervenant']);
	$numprojet = addslashes($_POST['numprojet']);
    // On vérifie si c'est une modification de news ou pas
    if ($_POST['noprestation'] == 0)
    {
        // Ce n'est pas une modification, on crée une nouvelle entrée dans la table
       $requete="INSERT INTO prestation pr, intervenant i, necessiter n (nomprestation, libtype, nommodule, numintervenant, numprojet) VALUES ('','" . $nomprestation . "', '" . $libtype . "', '" . $nommodule . "', '" . $numintertvenant . "', '" . $numprojet . "') WHERE  n.numintervenant=i.numintervenant and n.noprestation=pr.noprestation";
     mssql_query($requete,$connexion);
 
 
	}
    else
    {
 
        $_POST['numprestation'] = addslashes($_POST['numprestation']);
        // C'est une modification, on met juste à jour le titre et le contenu
        $req="UPDATE prestation pr, intervenant i, necessiter n SET nomprestation='" . $nomprestation . "', libtype='" . $libtype . "', nommodule='" . $nommodule . "', numintervenant='" . $numintervenant . "', numprojet='" . $numprojet . "' WHERE noprestation='" . $_POST['noprestation'] . "' WHERE  n.numintervenant=i.numintervenant and n.noprestation=pr.noprestation";
    mssql_query($req,$connexion);
	}
}
}
?>
<table><tr>
<th>Modifier</th>
 
<th>nomprestation</th>
<th>type</th>
<th>module</th>
<th>intervenant</th>
<th>numprojet</th>
 
</tr>
<?php
 
$requete ="SELECT distinct pre.noprestation, nomprestation, libtype, nommodule, n.numintervenant, pre.numprojet
FROM prestation pre, intervenant i, necessiter n, projet p
where n.noprestation=pre.noprestation
and i.numintervenant= n.numintervenant and p.numprojet=pre.numprojet and login='".$login."' AND motpasse='".$password."'";
$resultat = mssql_query($requete,$connexion);
 
 
 
 
 
while ($ligne= mssql_fetch_array($resultat)) 
{
?>
<tr>
<td><?php echo '<a href="redigerprestation.php?modifierprestation=' . $ligne['noprestation'] . '">'; ?>Modifier</a></td>
 
 
<td><?php echo stripslashes($ligne['nomprestation']); ?></td>
<td><?php echo stripslashes($ligne['libtype']); ?></td>
<td><?php echo stripslashes($ligne['nommodule']); ?></td>
<td><?php echo stripslashes($ligne['numintervenant']); ?></td>
<td><?php echo stripslashes($ligne['numprojet']); ?></td>
</tr>
<?php
} 
?>
</table>