Erreur de sintaxe SQL je comprend pas

Résolu
dadou9101 Messages postés 110 Statut Membre -  
dadou9101 Messages postés 110 Statut Membre -
Bonjour, je n arrive pas a voir ou est mon ereur de sintaxe sur ma requete SQL

je veux en effet faire une modification de mon formulaire et j emploie cette requete la

UPDATE `checklist`.`magasin`
SET nom_mag = '$nom_mag',
ouv_mag = '$ouv_mag',
adr_mag = '$adr_mag',
adrliv_mag = '$adrliv_mag',
chefp_mag = '$chefp_mag',
cheft_mag = '$cheft_mag',
com_mag = '$com_mag',
comtel_mag = '$comtel_mag',
WHERE `magasin`.`id_mag` = 830920 LIMIT 1 ;

Pouvez vous m éclairez
Configuration: Windows XP
Firefox 3.0.8

6 réponses

  1. loupius
     
    Peut-être me fourvoyè-je, mais que signifie:
    `checklist`.`magasin`
    et
    `magasin`.`id_mag`
    A quoi correspond le point '.' ?
    0
    1. dadou9101 Messages postés 110 Statut Membre 5
       
      en faite je viens de corriger ma requete SQL

      UPDATE `magasin` SET nom_mag = '$nom_mag',
      ouv_mag = '$ouv_mag',
      adr_mag = '$adr_mag',
      adrliv_mag = '$adrliv_mag',
      chefp_mag = '$chefp_mag',
      cheft_mag = '$cheft_mag',
      com_mag = '$com_mag',
      comtel_mag = '$comtel_mag',
      WHERE `id_mag` =830920 LIMIT 1 ;

      mais meme la sa me met la meme erreur

      cheklist correspont au nom de ma base de donne
      et magasin au nom de ma table
      0
  2. P@t@ch0n Messages postés 603 Statut Membre 85
     
    Et l'erreur retournée est ?

    Sert à quoi le LIMIT sachant qu'un identifiant est unique.
    0
  3. loupius
     
    Peut-être me fourvoyè-je, mais que signifie:
    `magasin`
    et
    `id_mag`
    A quoi correspondent les quotes inversées '`' ?
    0
  4. P@t@ch0n Messages postés 603 Statut Membre 85
     
    Les quotes obliques, c'est un truc pourri de MySQL servant à pouvoir utiliser les mots réservés comme noms de bdd, tables ou colonnes.
    0
    1. dadou9101 Messages postés 110 Statut Membre 5
       
      Effectivement la limite me sert a rien mais jai toujours la meme erreur

      UPDATE `cheklist`.`magasin` SET nom_mag = '$nom_mag',
      ouv_mag = '$ouv_mag',
      adr_mag = '$adr_mag',
      adrliv_mag = '$adrliv_mag',
      chefp_mag = '$chefp_mag',
      cheft_mag = '$cheft_mag',
      com_mag = '$com_mag',
      comtel_mag = '$comtel_mag',
      WHERE `magasin`.`id_mag` =830920;

      #1064 - Erreur de syntaxe près de 'WHERE `magasin`.`id_mag` = 830920' à la ligne 9
      0
    2. loupius
       
      Merci pour le renseignement.
      0
  5. Vous n’avez pas trouvé la réponse que vous recherchez ?

    Posez votre question
  6. P@t@ch0n Messages postés 603 Statut Membre 85
     
    La virgule en trop juste avant le WHERE.
    0
  7. dadou9101 Messages postés 110 Statut Membre 5
     
    UPDATE `magasin`

    SET
    nom_mag = '$nom_mag',
    ouv_mag = '$ouv_mag',
    adr_mag = '$adr_mag',
    adrliv_mag = '$adrliv_mag',
    chefp_mag = '$chefp_mag',
    cheft_mag = '$cheft_mag',
    com_mag = '$com_mag',
    comtel_mag = '$comtel_mag'

    WHERE `magasin`.`id_mag` = '$id_mag'

    sa fonctionne bien merci de m avoir eclairez
    0