Erreur Mysql impossible à trouver

Résolu
Bonjour,
Je m'arrache les cheuveux depuis maintenant 2h pour trouver mon erreur mysql mais je n'y arrive pas... Un petit coup de main serai le bienvenue :)

comme cela ça ne marche pas:
$req2 = "UPDATE table SET design='".intval($_POST['design'])."', programmation='".intval($_POST['programmation'])."', developpement='".intval($_POST['developpement'])."', databases='".intval($_POST['databases'])."', reseaux='".intval($_POST['reseaux'])."', telecoms='".intval($_POST['telecoms'])."', algorithmique='".intval($_POST['algorithmique'])."', hardware='".intval($_POST['hardware'])."', software='".intval($_POST['software'])."', windows='".intval($_POST['windows'])."', linux='".intval($_POST['linux'])."', serveurs='".intval($_POST['serveurs'])."', bureautique='".intval($_POST['bureautique'])."' WHERE id ='".$_POST['id']."'";


si j'enlève databases='".intval($_POST['databases'])."', ça marche:
$req2 = "UPDATE table SET design='".intval($_POST['design'])."', programmation='".intval($_POST['programmation'])."', developpement='".intval($_POST['developpement'])."', reseaux='".intval($_POST['reseaux'])."', telecoms='".intval($_POST['telecoms'])."', algorithmique='".intval($_POST['algorithmique'])."', hardware='".intval($_POST['hardware'])."', software='".intval($_POST['software'])."', windows='".intval($_POST['windows'])."', linux='".intval($_POST['linux'])."', serveurs='".intval($_POST['serveurs'])."', bureautique='".intval($_POST['bureautique'])."' WHERE id ='".$_POST['id']."'";


message d'erreur:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases='0', reseaux='0', telecoms='0', algorithmique='0', hardware='0', softw' at line 1

je ne comprends vraiment pas pourquoi ce databases='".intval($_POST['databases'])."', pose problème, j'ai essayé sans le intval mais c'est pareil...
je l'ai réécris à la fin, essayé le copié collé mais pareil...

merci de votre aide!

1 réponse

  • Votes
  • Date
  • Date décroissante
  1. T'as essayé sans les simples quotes?

    $req2 = "UPDATE table SET design='".intval($_POST['design'])."', programmation='".intval($_POST['programmation'])."', developpement='".intval($_POST['developpement'])."', databases=".intval($_POST['databases']).", reseaux='".intval($_POST['reseaux'])."', telecoms='".intval($_POST['telecoms'])."', algorithmique='".intval($_POST['algorithmique'])."', hardware='".intval($_POST['hardware'])."', software='".intval($_POST['software'])."', windows='".intval($_POST['windows'])."', linux='".intval($_POST['linux'])."', serveurs='".intval($_POST['serveurs'])."', bureautique='".intval($_POST['bureautique'])."' WHERE id ='".$_POST['id']."'";


    Développeur web -xHTML, CSS, PhP, MySQL, JavaScript, Ajax-
    Développeur logiciel -Windev, C#-
    Site perso: Bientôt dispo.
    1. oui toujours le même problème...
      par contre je viens de remarquer quelque chose de très surprenant...
      j'ai remplacé databases= par telecoms= et la requete marche!
      c'est le mot databases= qui pose problème.... serai-ce un mot reservé ou quelques chose du genre? Ma colonne s'appelle databases....
    2. Ah oui j'y ai même pas pensé, c'est un mot clé, il faut que tu la renomme.
    3. c'est bon ça marche!
      merci de ton aide!