Bonjour,
Je vous écris car j'ai grandement besoin de votre aide.
J'ai 5 tables sur MySQL et je voudrais insérer certains champs dans ces 5 tables dans une seule.
Voici la requête que j'ai fais dans un fichier *.php, cependant elle ne fonctionne pas mais ne me revois aucune erreur.
Je n'arrive pas a comprendre ce qui cloche.
J'aimerais beaucoup avoir votre aide.
Merci à tous !
Mélanie
Je vous écris car j'ai grandement besoin de votre aide.
J'ai 5 tables sur MySQL et je voudrais insérer certains champs dans ces 5 tables dans une seule.
Voici la requête que j'ai fais dans un fichier *.php, cependant elle ne fonctionne pas mais ne me revois aucune erreur.
Code:
$sql="INSERT INTO relait_mip.gg_eleves
SELECT gg_resp1.UAJ, gg_resp1.ANNEE_SCOLAIRE, gg_el1.ELEVE_ID, gg_el1.ELENOET, gg_el1.NOM, gg_el1.PRENOM, gg_structure.CODE_STRUCTURE, gg_structure.LIBELLE_LONG, gg_structure.CODE_MEF, mip_diplomes.type_dip, mip_diplomes.libelle, gg_el1.DATE_NAISS, gg_resp3.LIGNE1_ADRESSE, gg_resp3.LIGNE2_ADRESSE, gg_resp3.LIGNE3_ADRESSE, gg_resp3.CODE_POSTAL, gg_resp3.LL_PAYS, gg_resp3.LIBELLE_POSTAL, gg_resp3.COMMUNE_ETRANGERE
FROM relait_mip.gg_el1, relait_mip.gg_el2, relait_mip.gg_resp1, relait_mip.gg_resp2, relait_mip.gg_resp3, relait_mip.gg_structure, relait_mip.gg_mef_dip, relait_mip.mip_diplomes
WHERE gg_el1.ELEVE_ID = gg_resp2.ELEVE_ID2
AND gg_resp1.PERSONNE_ID = gg_resp2.PERSONNE_ID2
AND gg_resp1.ADRESSE_ID = gg_resp3.ADRESSE_ID3
AND gg_el2.CODE_STRUCTURE9 = gg_structure.CODE_STRUCTURE
AND gg_structure.CODE_MEF = gg_mef_dip.CODE_MEF
AND gg_mef_dip.code_diplome = mip_diplomes.c_diplome";
$req=mysql_query($sql)or die (mysql_error());
Je n'arrive pas a comprendre ce qui cloche.
J'aimerais beaucoup avoir votre aide.
Merci à tous !
Mélanie