Syntaxe de "INSERT INTO"
Résolu/Fermé
MoYoX
Messages postés
127
Date d'inscription
jeudi 4 juin 2009
Statut
Membre
Dernière intervention
21 mars 2014
-
9 juin 2009 à 11:14
MoYoX Messages postés 127 Date d'inscription jeudi 4 juin 2009 Statut Membre Dernière intervention 21 mars 2014 - 10 juin 2009 à 08:46
MoYoX Messages postés 127 Date d'inscription jeudi 4 juin 2009 Statut Membre Dernière intervention 21 mars 2014 - 10 juin 2009 à 08:46
A voir également:
- Syntaxe de "INSERT INTO"
- Touche insert - Guide
- Disk boot failure insert system disk and press enter - Guide
- Reboot and select proper boot device or insert boot media in selected boot device and press a key - Forum Windows
- Syntaxe precise - Forum Mail
- Trouver erreur de syntaxe fichier txt ✓ - Forum Programmation
7 réponses
sya21
Messages postés
425
Date d'inscription
lundi 12 novembre 2007
Statut
Membre
Dernière intervention
7 janvier 2010
43
9 juin 2009 à 11:17
9 juin 2009 à 11:17
avant de mettre ton values tu dois inserer les champs que tu souhaite enregistrer
dmcmd.runsql "insert into tatable(cham1 , camp2...)values(" & me.champ1 & ",....
dmcmd.runsql "insert into tatable(cham1 , camp2...)values(" & me.champ1 & ",....
Bonjour
Si ta table a bien 15 champs, tu n'es pas obligé de les préciser dans la requête. A-t-elle bien 15 champs ?
Mais surtout pour savoir ce qui se passe vraiment, il faut afficher le message d'erreur avec
mysql_query($query) or die (mysql_error());
Si ta table a bien 15 champs, tu n'es pas obligé de les préciser dans la requête. A-t-elle bien 15 champs ?
Mais surtout pour savoir ce qui se passe vraiment, il faut afficher le message d'erreur avec
mysql_query($query) or die (mysql_error());
mehdi_84
Messages postés
103
Date d'inscription
jeudi 17 avril 2008
Statut
Membre
Dernière intervention
4 janvier 2011
9 juin 2009 à 12:19
9 juin 2009 à 12:19
j'ai le même problème voici mes codes:
mysql_query("INSERT INTO sondage (choix1, resultat)"." VALUES ('$choix', '$pseudo' ) ")
or die("Impossible d'insérer le résultat du sondage : ".mysql_error());
echo "Merci";
?>
mysql_query("INSERT INTO sondage (choix1, resultat)"." VALUES ('$choix', '$pseudo' ) ")
or die("Impossible d'insérer le résultat du sondage : ".mysql_error());
echo "Merci";
?>
HostOfSeraphim
Messages postés
6750
Date d'inscription
jeudi 2 février 2006
Statut
Contributeur
Dernière intervention
31 juillet 2016
1 607
9 juin 2009 à 12:43
9 juin 2009 à 12:43
Merci de créer un nouveau sujet pour ton problème, sinon on ne va pas s'y retrouver entre ton problème et celui de l'initiateur du sujet.
HostOfSeraphim
Messages postés
6750
Date d'inscription
jeudi 2 février 2006
Statut
Contributeur
Dernière intervention
31 juillet 2016
1 607
9 juin 2009 à 12:31
9 juin 2009 à 12:31
Vérifie :
- La syntaxe du nom de la table et des champs
- Via un echo sur chaque variable, que tes variables ne sont pas vides
- Le message d'erreur exact affiché.
- La syntaxe du nom de la table et des champs
- Via un echo sur chaque variable, que tes variables ne sont pas vides
- Le message d'erreur exact affiché.
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
mehdi_84
Messages postés
103
Date d'inscription
jeudi 17 avril 2008
Statut
Membre
Dernière intervention
4 janvier 2011
9 juin 2009 à 12:41
9 juin 2009 à 12:41
voici la base on vois bien 6 enregistrement :
Base de données iciturquie_db - table sondage
Votre requête SQL a été exécutée avec succès
requête SQL : [Modifier]
ALTER TABLE `sondage` DROP `choix`;
[ Afficher ] [ Sélectionner ] [ Insérer ] [ Vider ] [ Supprimer ]
Champ Type Attributs Null Défaut Extra Action
choix1 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix2 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix3 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix4 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix5 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix6 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix7 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
pseudo tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
resultat tinyint(20) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
Pour la sélection : Pour la sélection : Ou
Espace utilisé :
Type Espace
Données 60 Octets
Index 1 024 Octets
Total 1 084 Octets
Statistiques :
Information Valeur
Format fixe
Enregistrements 6
Longueur enr. ø 10
Taille enr. ø 181 Octets
et voici ce que ca donne quand je fait afficher :
Base de données iciturquie_db - table sondage
Affichage des enregistrements 0 - 6 (6 total)
requête SQL : [Modifier]
SELECT * FROM `sondage` LIMIT 0, 30
lignes à partir de
choix1 choix2 choix3 choix4 choix5 choix6 choix7 pseudo resultat
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
lignes à partir de
Insérer un nouvel enregistrement
Intitulé :
des 0 partout
Base de données iciturquie_db - table sondage
Votre requête SQL a été exécutée avec succès
requête SQL : [Modifier]
ALTER TABLE `sondage` DROP `choix`;
[ Afficher ] [ Sélectionner ] [ Insérer ] [ Vider ] [ Supprimer ]
Champ Type Attributs Null Défaut Extra Action
choix1 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix2 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix3 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix4 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix5 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix6 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
choix7 tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
pseudo tinyint(4) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
resultat tinyint(20) Non 0 Modifier Supprimer Primaire Index Unique Texte entier
Pour la sélection : Pour la sélection : Ou
Espace utilisé :
Type Espace
Données 60 Octets
Index 1 024 Octets
Total 1 084 Octets
Statistiques :
Information Valeur
Format fixe
Enregistrements 6
Longueur enr. ø 10
Taille enr. ø 181 Octets
et voici ce que ca donne quand je fait afficher :
Base de données iciturquie_db - table sondage
Affichage des enregistrements 0 - 6 (6 total)
requête SQL : [Modifier]
SELECT * FROM `sondage` LIMIT 0, 30
lignes à partir de
choix1 choix2 choix3 choix4 choix5 choix6 choix7 pseudo resultat
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
Modifier Effacer 0 0 0 0 0 0 0 0 0
lignes à partir de
Insérer un nouvel enregistrement
Intitulé :
des 0 partout
mehdi_84
Messages postés
103
Date d'inscription
jeudi 17 avril 2008
Statut
Membre
Dernière intervention
4 janvier 2011
9 juin 2009 à 12:47
9 juin 2009 à 12:47
ok pardon
MoYoX
Messages postés
127
Date d'inscription
jeudi 4 juin 2009
Statut
Membre
Dernière intervention
21 mars 2014
3
10 juin 2009 à 08:46
10 juin 2009 à 08:46
Merci à tous pour les réponses,
Il se trouve en effet que ma table avait plus de champs que ce que je voulais remplir !
J'ai corrigé ceci avec des
merci !
Il se trouve en effet que ma table avait plus de champs que ce que je voulais remplir !
J'ai corrigé ceci avec des
' 'vides et ça fonctionne.
merci !