JuraX: mysql_query Problem

Hi,
ich habe ein Problem mit mysql query und variablen:

$connection=mysql_connect($mysqlhost, $mysqluser, $mysqlpwd) or die ("Verbindungsversuch fehlgeschlagen");  
 mysql_select_db($mysqldb, $connection) or die("Konnte die Datenbank $mysqldb nicht waehlen.");  
  
  
 $sql = 'UPDATE [online-hiorg].[alert]  
    SET  
            `id` = "1"  
			`wache` = "{$wache}"  
			`fahrzeuge` = "{$fahrzeug}"  
			`strasse` = "{$strase}"  
			`plz` = "{$plz}"  
			`ort` = "{$ort}"  
			`fon` = "{fon}"  
			`stichwort` = "{$stichwort}"  
			`object` = "{$objekt}"  
			`mitteiler` = "{$mitvon}"  
			`masnahme` = "{$masnahme}"  
			`kommentar` = "{$kommentar}"  
			  
    WHERE `alert`.`id` = 1 LIMIT 1';  
  
$adressen_query = mysql_query($sql) or die(mysql_error());  

Er springt leider immer auf die mit folgender aussage:
<<< 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 '[online-hiorg].[alert] SET id = "1" wache = "{$wache}" ' at line 1 >>>

Kann mir jmd sagen , wie ich es richtig machen kann?

--
Programmieren ist eine Kunst, AutoIt ist der Pinsel.
(http://AutoIt.de)
  1. Hi JuraX!

    <<< 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 '[online-hiorg].[alert] SET id = "1" wache = "{$wache}" ' at line 1 >>>

    Kann mir jmd sagen , wie ich es richtig machen kann?

    Du musst Kommas zwischen die einzelnen Zuweisungen setzen.

    mfG
    Benjamin

    --
    For animals, the entire universe has been neatly divided into things to (a) mate with, (b) eat, (c) run away from, and (d) rocks.
    1. 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 '[online-hiorg].[alert] SET id = "1", wache = "{$wache}"' at line 1

      $connection=mysql_connect($mysqlhost, $mysqluser, $mysqlpwd) or die ("Verbindungsversuch fehlgeschlagen");  
       mysql_select_db($mysqldb, $connection) or die("Konnte die Datenbank $mysqldb nicht waehlen.");  
        
        
       $sql = 'UPDATE [online-hiorg].[alert]  
          SET  
                  `id` = "1",  
      			`wache` = "{$wache}",  
      			`fahrzeuge` = "{$fahrzeug}",  
      			`strasse` = "{$strase}",  
      			`plz` = "{$plz}",  
      			`ort` = "{$ort}",  
      			`fon` = "{fon}",  
      			`stichwort` = "{$stichwort}",  
      			`object` = "{$objekt}",  
      			`mitteiler` = "{$mitvon}",  
      			`masnahme` = "{$masnahme}",  
      			`kommentar` = "{$kommentar}",  
      			  
          WHERE `alert`.`id` = 1 LIMIT 1';  
        
      $adressen_query = mysql_query($sql) or die(mysql_error());
      

      leider nicht...

      --
      Programmieren ist eine Kunst, AutoIt ist der Pinsel.
      (http://AutoIt.de)
      1. leider nicht...

        Sei doch so nett und mach dir eine Debug-Ausgabe des eigentlichen SQL-Statements.

        1. wie?
          das ist die Ausgabe:

          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 '[online-hiorg].[alert] SET id = "1", wache = "{$wache}"' at line 1

          --
          Programmieren ist eine Kunst, AutoIt ist der Pinsel.
          (http://AutoIt.de)
          1. wie?

            ich würd's einfach mit echo $sql; versuchen ...

            1. ich habs schon!

              $sql = "UPDATE `online-hiorg`.`alert`  
               SET  
              `plz` =  '{$plz}',  
              `ort` = '{$ort}',  
              `fon` = '{$fon}',  
              `stichwort` = '{$stichwort}',  
              `object` = '{$objekt}',  
              `mitteiler` = '{$mitvon}',  
              `masnahme` = '{$masnahme} ',  
              `kommentar` = '{$kommentar}',  
              `strasse` = '{$strasse}',  
              `wache` = '{$wache}',  
              `fahrzeuge` = '{$fahrzeug}'  
                
              WHERE `alert`.`id` =1 LIMIT 1";
              
              --
              Programmieren ist eine Kunst, AutoIt ist der Pinsel.
              (http://AutoIt.de)
              1. Hi!

                ich habs schon!

                $sql = "UPDATE online-hiorg.alert

                SET
                plz =  '{$plz}',
                ort = '{$ort}',
                fon = '{$fon}',
                stichwort = '{$stichwort}',
                object = '{$objekt}',
                mitteiler = '{$mitvon}',
                masnahme = '{$masnahme} ',
                kommentar = '{$kommentar}',
                strasse = '{$strasse}',
                wache = '{$wache}',
                fahrzeuge = '{$fahrzeug}'

                WHERE alert.id =1 LIMIT 1";

                  
                Das ist schonmal die halbe Miete. Und nun noch statt der geschweiften Klammern den [Kontextwechsel](http://aktuell.de.selfhtml.org/artikel/php/kontextwechsel/) beachten.  
                  
                  
                Lo!
                
  2. Hi!

    $sql = 'UPDATE [online-hiorg].[alert]

    Verwende lieber MSQL-Syntax und nicht die von MS-SQL. Auskünfte dazu gibt das Manual, zum Beispiel dort: http://dev.mysql.com/doc/refman/5.1/en/identifiers.html.

    Lo!