IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

PHP & Base de données Discussion :

maj base de donnée


Sujet :

PHP & Base de données

  1. #1
    Membre du Club
    Étudiant
    Inscrit en
    Janvier 2007
    Messages
    121
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2007
    Messages : 121
    Points : 58
    Points
    58
    Par défaut maj base de donnée
    Bonjours

    dans la page qui suis, j'affiche des textbox et leur contenu son des infos dans la base de donnée

    a partir de la, j'aimerai pouvoir modifier les information dans mes text box et faire la mise à jour de ces changements dans ma base de donnée

    voici le code de ma page en général
    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
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    <head>
    <link href = "style.css" rel = "stylesheet" type = "text/css" />
    </head>
     
    <?php
    require "bd-mysql.php";
     
    $id = $_GET['id'];//on reprend la variable passée dans l'url
     
     
    $req = mysql_query('SELECT * FROM projet WHERE nom_projet = "'.$id.'"');//on veut le nom du projet qui correspond à la ligne
     
    $req2 = mysql_fetch_assoc($req);//on stock dans un tableau
     
    $id_projet =  $req2['id_projet'];//on affiche
     
     
     
     
    ?>
     
     
     
    <div id="page">
    <table><tbody>
    <tr>
    <td>
     
    <?php
    $reponse = mysql_query("SELECT * FROM projet WHERE id_projet = ".$id_projet."");
    while ($aff = mysql_fetch_assoc($reponse)){
     
    echo '<form action="?" method="post" name="nom_projet">
    <span>Nom du projet: </span><input type="text" value="'.$aff['nom_projet'].'">
    </form>';
    echo '<form action="?" method="post" name="echeance_projet">
    <span>Echéance du projet: </span><input type="text" value="'.$aff['echeance_projet'].'">
    </form>';
    echo '<form action="?" method="post" name="commentaire_projet">
    <span>Commentaires du projet: </span><input type="text" value="'.$aff['commentaire_projet'].'">
    </form>';
    echo '<form action="?" method="post" name="etat_projet">
    <span>Etat du projet: </span><input type="text" value="'.$aff['etat_projet'].'">
    </form>';
    }
     
    ?>
     
    </td>
    </tr>
    <tr>
    <td>
    <?php
    $reponse2 = mysql_query("SELECT * FROM client WHERE id_projet = ".$id_projet."");
    while ($aff2 = mysql_fetch_assoc($reponse2)){
     
    echo '<form action="?" method="post" name="nom_client">
    <span>Nom du client: </span><input type="text" value="'.$aff2['nom_client'].'">
    </form>';
    echo '<form action="?" method="post" name="adresse_client">
    <span>Adresse du client: </span><input type="text" value="'.$aff2['adresse_client'].'">
    </form>';
    echo '<form action="?" method="post" name="email_client">
    <span>Email du client: </span><input type="text" value="'.$aff2['email_client'].'">
    </form>';
    echo '<form action="?" method="post" name="telephone_client">
    <span>Telephone du client: </span><input type="text" value="'.$aff2['telephone_client'].'">
    </form>';
    echo '<form action="?" method="post" name="fax_client">
    <span>Fax du client: </span><input type="text" value="'.$aff2['fax_client'].'">
    </form>';
     
    }
    ?>
    </td>
    </tr>
    <tr>
    <td>
     
    <?php
    $reponse = mysql_query("SELECT * FROM intervenant WHERE id_projet = ".$id_projet."");
    while ($aff = mysql_fetch_assoc($reponse)){
     
    echo '<form action="?" method="post" name="nom_intervenant">
    <span>Nom de l\'intervenant: </span><input type="text" value="'.$aff['nom_intervenant'].'">
    </form>';
    echo '<form action="?" method="post" name="prenom_intervenant">
    <span>Prenom de l\'intervenant: </span><input type="text" value="'.$aff['prenom_intervenant'].'">
    </form>';
    echo '<form action="?" method="post" name="telephone_intervenant">
    <span>Telephone de l\'intervenant: </span><input type="text" value="'.$aff['telephone_intervenant'].'">
    </form>';
    echo '<form action="?" method="post" name="email_intervenant">
    <span>Email de l\'intervenant: </span><input type="text" value="'.$aff['email_intervenant'].'">
    </form>';
    echo '<form action="?" method="post" name="societe_intervenant">
    <span>Nom de la société intervenante: </span><input type="text" value="'.$aff['societe_intervenant'].'">
    </form>';
    }
     
    ?>
     
    </td>
    </tr>
    <tr>
    <td>
     
    <?php
    $reponse = mysql_query("SELECT * FROM contact WHERE id_projet = ".$id_projet."");
    while ($aff = mysql_fetch_assoc($reponse)){
    echo '<form action="?" method="post" name="nom_contact">
    <span>Nom du contact: </span><input type="text" value="'.$aff['nom_contact'].'">
    </form>';
    echo '<form action="?" method="post" name="prenom_contact">
    <span>Prenom du contact: </span><input type="text" value="'.$aff['prenom_contact'].'">
    </form>';
    echo '<form action="?" method="post" name="telephone_contact">
    <span>Telephone du contact: </span><input type="text" value="'.$aff['telephone_contact'].'">
    </form>';
    echo '<form action="?" method="post" name="email_contact">
    <span>Email du contact: </span><input type="text" value="'.$aff['email_contact'].'">
    </form>';
    }
     
    ?>
     
    <?php
    //pour mettre à jour la base de donnée
    //je stock dans une variable les données présentes dans mes textbox
     
     
    			$nom_client = $_POST['nom_client'];
    			$adresse_client = $_POST['adresse_client'];
    			$email_client = $_POST['email_client'];
    			$telephone_client = $_POST['telephone_client'];
    			$fax_client = $_POST['fax_client'];
    			$nom_projet = $_POST['nom_projet'];
    			$echeance_projet = $_POST['echeance_projet'];
    			$commentaire_projet = $_POST['commentaire_projet'];
    			$etat_projet = $_POST['etat_projet']; 
    			$nom_contact = $_POST['nom_contact'];
    			$prenom_contact = $_POST['prenom_contact'];
    			$telephone_contact = $_POST['telephone_contact'];
    			$email_contact = $_POST['email_contact'];
    			$nom_intervenant = $_POST['nom_intervenant'];
    			$prenom_intervenant = $_POST['prenom_intervenant'];
    			$tel_intervenant = $_POST['tel_intervenant'];
    			$email_intervenant = $_POST['email_intervenant'];
    			$societe_intervenant = $_POST['societe_intervenant'];
     
     
    //j'exécute la requête
     
    				$rmajproj = mysql_query(	"UPDATE projet SET 
    									  nom_projet = 'nom_projet'
    							  commentaire_projet = 'commentaire_projet'
    							     echeance_projet = 'echeance_projet'
    								     etat_projet = 'etat_projet'   ");
     
     
    					$rmajcli = mysql_query("UPDATE client SET
    									  nom_client = 'nom_client'
    					              adresse_client = 'adresse_client'
    								    email_client = 'email_client'	
    								telephone_client = 'telephone_client'	
    								   	  fax_client = 'fax_client'");
     
    				  $rmajcontact = mysql_query"(UPDATE contact SET 
    				 					 nom_contact = 'nom_contact'
    				   				  prenom_contact = 'prenom_contact'
    							   telephone_contact = 'telephone_contact'
    							       email_contact = 'email_contact'");
     
     
     
     
    	      $rmajinter = mysql_query("UPDATE intervenant SET 
    		 						 nom_intervenant = 'nom_intervenant'
    							  prenom_intervenant = 'prenom_intervenant'
    						   telephone_intervenant = 'telephone_intervenant'
    							   email_intervenant = 'email_intervenant'
    							 societe_intervenant = 'societe_intervenant'");
     
     
     
     
    //j'affiche la requête pour tester
     
     
     
     
     
    					?>
     
     
    <form>
    <input name='soumettre' type='submit' value='Envoyer'></td></tr>
    </form>
     
    </td>
    </tr>
    </tbody></table>
    </div>
    et voici le code que j'ai écrit pour faire la mise à jour

    nb j'ai 3 yables concernées et dans mes requêtes update j'ai mis la colonne concernée et le nom du text box ou s'affiche les données modifiées

    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
    <?php
    //pour mettre à jour la base de donnée
    //je stock dans une variable les données présentes dans mes textbox
     
     
    			$nom_client = $_POST['nom_client'];
    			$adresse_client = $_POST['adresse_client'];
    			$email_client = $_POST['email_client'];
    			$telephone_client = $_POST['telephone_client'];
    			$fax_client = $_POST['fax_client'];
    			$nom_projet = $_POST['nom_projet'];
    			$echeance_projet = $_POST['echeance_projet'];
    			$commentaire_projet = $_POST['commentaire_projet'];
    			$etat_projet = $_POST['etat_projet']; 
    			$nom_contact = $_POST['nom_contact'];
    			$prenom_contact = $_POST['prenom_contact'];
    			$telephone_contact = $_POST['telephone_contact'];
    			$email_contact = $_POST['email_contact'];
    			$nom_intervenant = $_POST['nom_intervenant'];
    			$prenom_intervenant = $_POST['prenom_intervenant'];
    			$tel_intervenant = $_POST['tel_intervenant'];
    			$email_intervenant = $_POST['email_intervenant'];
    			$societe_intervenant = $_POST['societe_intervenant'];
     
     
    //j'exécute la requête
     
    				$rmajproj = mysql_query(	"UPDATE projet SET 
    									  nom_projet = 'nom_projet'
    							  commentaire_projet = 'commentaire_projet'
    							     echeance_projet = 'echeance_projet'
    								     etat_projet = 'etat_projet'   ");
     
     
    					$rmajcli = mysql_query("UPDATE client SET
    									  nom_client = 'nom_client'
    					              adresse_client = 'adresse_client'
    								    email_client = 'email_client'	
    								telephone_client = 'telephone_client'	
    								   	  fax_client = 'fax_client'");
     
    				  $rmajcontact = mysql_query"(UPDATE contact SET 
    				 					 nom_contact = 'nom_contact'
    				   				  prenom_contact = 'prenom_contact'
    							   telephone_contact = 'telephone_contact'
    							       email_contact = 'email_contact'");
     
     
     
     
    	      $rmajinter = mysql_query("UPDATE intervenant SET 
    		 						 nom_intervenant = 'nom_intervenant'
    							  prenom_intervenant = 'prenom_intervenant'
    						   telephone_intervenant = 'telephone_intervenant'
    							   email_intervenant = 'email_intervenant'
    							 societe_intervenant = 'societe_intervenant'");
     
     
     
     
    //j'affiche la requête pour tester
     
     
     
     
     
    					?>
     
     
    <form>
    <input name='soumettre' type='submit' value='Envoyer'></td></tr>
    </form>
    merci de m'aider

  2. #2
    Membre éclairé Avatar de |PaRa-BoL
    Profil pro
    Inscrit en
    Novembre 2003
    Messages
    738
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : France

    Informations forums :
    Inscription : Novembre 2003
    Messages : 738
    Points : 876
    Points
    876
    Par défaut
    Bonjour,

    Originale comme identitation

    Heu sinon dans tout tes updates où sont les variables ? tu as oublié les $ devant ?

  3. #3
    Membre habitué
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    264
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2006
    Messages : 264
    Points : 141
    Points
    141
    Par défaut
    Bonjour, ça fait un peu polymorphisme ce genre de code,
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $nom_projet = $_POST['nom_projet'];

    de plus le nom des champs sont identique...un peu dur de s'y retrouver! Il est important de bien différencier les tables, champs des variables ainsi que les $_POST.

    Exemple:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $nom_projet = $_POST['_nom_projet'];


    Ensuite:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $majproj = mysql_query("UPDATE t_projet SET c_nom_projet='$nom_projet', c_commentaire_projet='$commentaire_projet', c_echeance_projet='$echeance_projet', c_etat_projet='$etat_projet'");

  4. #4
    Membre du Club
    Étudiant
    Inscrit en
    Janvier 2007
    Messages
    121
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2007
    Messages : 121
    Points : 58
    Points
    58
    Par défaut
    ok je vais essayer comme ca et je vous tiens au courant merci

  5. #5
    Membre du Club
    Étudiant
    Inscrit en
    Janvier 2007
    Messages
    121
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2007
    Messages : 121
    Points : 58
    Points
    58
    Par défaut
    Bien j'ai regarder un peu ma structure et j'ai corrigé en fonction::

    ici un text box

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    echo '<form action="?" method="post" name="tbnom_projet">
    <span>Nom du projet: </span><input type="text" value="'.$aff['nom_projet'].'">
    </form>';
    il a bien comme nom tbnom_projet

    aprés j'ai stocké son contenu dans une variable

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $nom_projet = $_POST['tbnom_projet'];

    et parés j'ai mis ca dans le UPDATE qui le concerne

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    $rmajproj = mysql_query("UPDATE projet SET 
    									  nom_projet = '$nom_projet'
    							  commentaire_projet = '$commentaire_projet'
    							     echeance_projet = '$echeance_projet'
    								     etat_projet = '$etat_projet'");

    merci de m'aider

    a au fait rien ne s'affiche c'est ca mon probléme et aucune mise à jour se fait dans ma base

  6. #6
    Membre du Club
    Étudiant
    Inscrit en
    Janvier 2007
    Messages
    121
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2007
    Messages : 121
    Points : 58
    Points
    58
    Par défaut
    bon j'avance doucement mais surement
    maintenant le seul probléme qui subsiste c'est la mise a jour qui se fait pas

  7. #7
    Membre éclairé Avatar de J0r_x
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2006
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Mai 2006
    Messages : 804
    Points : 751
    Points
    751
    Par défaut
    Pout ton update n'oublie pas de mettre la ligne que tu update sinon tu va modifier toute ta table :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    $rmajproj = mysql_query("UPDATE projet SET 
    	 nom_projet = '$nom_projet',	
    	 commentaire_projet = '$commentaire_projet',				 echeance_projet = '$echeance_projet',
                  etat_projet = '$etat_projet'
                  WHERE cle_prim_de_ta_table='id'");
    Aucune aide par MP, utilisez le forum.

  8. #8
    Membre expert Avatar de Amara
    Profil pro
    Inscrit en
    Juillet 2004
    Messages
    2 688
    Détails du profil
    Informations personnelles :
    Localisation : France, Sarthe (Pays de la Loire)

    Informations forums :
    Inscription : Juillet 2004
    Messages : 2 688
    Points : 3 115
    Points
    3 115
    Par défaut
    Et pour voir d'éventuelles erreurs il faut toujours terminer les lignes contenant une fonction mysql_XXX par "or die(mysql_error())".
    Pas de questions techniques par MP, le forum est là pour ça et est plus efficace.

    Orthographe : une connexion (avec un x), un langage (sans u), une requête (un seul t), 'une quote' (avec qu), une syntaxe (sans h)

  9. #9
    Membre du Club
    Étudiant
    Inscrit en
    Janvier 2007
    Messages
    121
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2007
    Messages : 121
    Points : 58
    Points
    58
    Par défaut
    le principal de ce que je souhaite fonctionne

    ca modifie bien tout dans ma base
    mais
    par exp je modifie le nom du projet
    mais dans les lignes de ma table ou sont insérés d'autres projet les autres s'éffacent et le projet que j'ai modifié remplace les autres

    donc je c pas trop comment faire

    voici mon fichier avec les text box
    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
    <head>
    <link href = "style.css" rel = "stylesheet" type = "text/css" />
    </head>
     
    <?php
    require "bd-mysql.php";
    $id = $_GET['id'];//on reprend la variable passée dans l'url
    $req = mysql_query('SELECT * FROM projet WHERE nom_projet = "'.$id.'"');//on veut le nom du projet qui correspond à la ligne
    $req2 = mysql_fetch_assoc($req);//on stock dans un tableau
    $id_projet =  $req2['id_projet'];//on affiche
     
    ?>
     
    <div id="page">
    <table><tbody>
    <tr>
    <td>
    															<!--table projet-->
    <?php
    $reponse = mysql_query("SELECT * FROM projet WHERE id_projet = ".$id_projet."");
    $aff = mysql_fetch_assoc($reponse);
    echo '<form action="appelformulaire.php" method="post">
    <span>Nom du projet: </span><input type="text" value="'.$aff['nom_projet'].'" name="form_nom_proj">';
    echo '<span>Echéance du projet: </span><input type="text" value="'.$aff['echeance_projet'].'" name="form_eche_proj">' ;
    echo '<span>Commentaires du projet: </span><input type="text" value="'.$aff['commentaire_projet'].'" name="form_comment_proj">';
    echo '<span>Etat du projet: </span><input type="text" value="'.$aff['etat_projet'].'" name="form_etat_proj">';
    ?>
    </td>
    </tr>
    <tr>
    <td>
    															<!--table client-->
    <?php
    $reponse2 = mysql_query("SELECT * FROM client WHERE id_projet = ".$id_projet."");
    $aff2 = mysql_fetch_assoc($reponse2);
    echo '<span>Nom du client: </span><input type="text" value="'.$aff2['nom_client'].'" name="form_nom_cli">';
    echo '<span>Adresse du client: </span><input type="text" value="'.$aff2['adresse_client'].'" name="form_ad_cli">';
    echo '<span>Email du client: </span><input type="text" value="'.$aff2['email_client'].'" name="form_mail_cli">';
    echo '<span>Telephone du client: </span><input type="text" value="'.$aff2['telephone_client'].'" name="form_tel_cli">';
    echo '<span>Fax du client: </span><input type="text" value="'.$aff2['fax_client'].'" name="form_fax_cli">';
    ?>
    </td>
    </tr>
    <tr>
    <td>
    															<!--table intervenant-->
    <?php
    $reponse = mysql_query("SELECT * FROM intervenant WHERE id_projet = ".$id_projet."");
    $aff = mysql_fetch_assoc($reponse);
    echo '<span>Nom de l\'intervenant: </span><input type="text" value="'.$aff['nom_intervenant'].'" name="form_nom_inter">';
    echo '<span>Prenom de l\'intervenant: </span><input type="text" value="'.$aff['prenom_intervenant'].'" name="form_pren_inter">';
    echo '<span>Telephone de l\'intervenant: </span><input type="text" value="'.$aff['prenom_intervenant'].'" name="form_tel_inter">';
    echo '<span>Email de l\'intervenant: </span><input type="text" value="'.$aff['email_intervenant'].'" name="form_mail_inter">';
    echo '<span>Nom de la société intervenante: </span><input type="text" value="'.$aff['societe_intervenant'].'" name="form_soc_inter">';
    ?>
    </td>
    </tr>
    <tr>
    <td>
    																<!--table contact-->
    <?php
    $reponse = mysql_query("SELECT * FROM contact WHERE id_projet = ".$id_projet."");
    $aff = mysql_fetch_assoc($reponse);
    echo '<span>Nom du contact: </span><input type="text" value="'.$aff['nom_contact'].'" name="form_nom_cont">';
    echo '<span>Prenom du contact: </span><input type="text" value="'.$aff['prenom_contact'].'" name="form_pre_cont">';
    echo '<span>Telephone du contact: </span><input type="text" value="'.$aff['telephone_contact'].'" name="form_tel_cont">';
    echo '<span>Email du contact: </span><input type="text" value="'.$aff['email_contact'].'" name="form_mail_cont">';
    echo '<input name="soumettre" type="submit" value="Envoyer"></form>';
    ?>
    </td>
    </tr>
    </tbody></table>
    </div>
    et voici la partie qui modifie dans la base

    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
    <?php
    require "bd-mysql.php";
     
     
    //pour mettre à jour la base de donnée
    //je stock dans une variable les données présentes dans mes textbox
     
    			$adresse_client = $_POST['form_ad_cli'];
    			$email_client = $_POST['form_mail_cli'];
    			$telephone_client = $_POST['form_tel_cli'];
    			$fax_client = $_POST['form_fax_cli'];
    			$nom_client = $_POST['form_nom_cli'];			
    			$nom_projet = $_POST['form_nom_proj'];
    			$echeance_projet = $_POST['form_eche_proj'];
    			$commentaire_projet = $_POST['form_comment_proj'];
    			$etat_projet = $_POST['form_etat_proj'];			
    			$nom_contact = $_POST['form_nom_cont'];
    			$prenom_contact = $_POST['form_pre_cont'];
    			$tel_contact = $_POST['form_tel_cont'];
    			$email_contact = $_POST['form_mail_cont'];		
    			$nom_intervenant = $_POST['form_nom_inter'];
    			$prenom_intervenant = $_POST['form_pren_inter'];
    			$tel_intervenant = $_POST['form_tel_inter'];
    			$email_intervenant = $_POST['form_mail_inter'];
    			$societe_intervenant = $_POST['form_soc_inter'];
     
    //j'exécute la requête
     
    					$rmajproj = mysql_query("UPDATE projet SET nom_projet = '$nom_projet', commentaire_projet = '$commentaire_projet', echeance_projet = '$echeance_projet', etat_projet = '$etat_projet'");							 
     
    				$rmajcli = mysql_query("UPDATE client SET nom_client = '$nom_client', adresse_client = '$adresse_client', email_client = '$email_client', telephone_client = '$telephone_client', fax_client = '$fax_client' where projet.id_projet=client.id_projet");
     
    				  $rmajcontact = mysql_query("UPDATE contact SET nom_contact = '$nom_contact', prenom_contact = '$prenom_contact', tel_contact = '$tel_contact', email_contact = '$email_contact' where contact.id_projet=projet.id_projet");
     
     
    					$rmajintervenant = mysql_query ("UPDATE intervenant SET nom_intervenant = '$nom_intervenant', prenom_intervenant = '$prenom_intervenant', telephone_intervenant = '$tel_intervenant', email_intervenant = '$email_intervenant', societe_intervenant = '$societe_intervenant' where intervenant.id_projet=projet.id_projet");
    					?>
    j'ai fait des jointures sauf dans projet mais je pense qu'il faut que je passe en paramétre l'id du projet entre ces deux pages mais je c pas ou mettre et quoi prendre

    merci de m'aider

  10. #10
    Membre éclairé Avatar de J0r_x
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mai 2006
    Messages
    804
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Mai 2006
    Messages : 804
    Points : 751
    Points
    751
    Par défaut
    Il faut que tu mette la colone de ta table qui represente la clé primaire.
    Aucune aide par MP, utilisez le forum.

  11. #11
    Membre du Club
    Étudiant
    Inscrit en
    Janvier 2007
    Messages
    121
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Janvier 2007
    Messages : 121
    Points : 58
    Points
    58
    Par défaut
    la table projet est commune a toute mes tables et et toute mes autres tables ont pour clef étrangére id_projet

Discussions similaires

  1. Réponses: 3
    Dernier message: 04/02/2013, 17h00
  2. sql2008 en miroring: creation de snapshot pour maj base de données
    Par scazikiss dans le forum Administration
    Réponses: 0
    Dernier message: 31/01/2013, 17h20
  3. [XL-2003] Problème de MAJ base de donnée
    Par Albatros47 dans le forum Macros et VBA Excel
    Réponses: 1
    Dernier message: 03/01/2010, 19h57
  4. Réponses: 3
    Dernier message: 02/05/2007, 17h44
  5. Réponses: 2
    Dernier message: 11/12/2006, 11h08

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo