Datensätze werden nicht in MySQL geschrieben

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    fehler ohne entsprechenden code zu posten ist überflüssign...

    Comment


    • #17
      hey leutz,

      hab das jetzt nochmal alles neu geschrieben um mehr übersicht zu erreichen, jetzt habe ich folgenden code entwickelt und habe leider immer noch den my sql fehler....

      PHP Code:
      for($i=0;$i<3;$i++) {
          
      $id[] = $i;    
      }

      for(
      $j=1;$j<3;$j++) {    
          echo 
      "$id[$j]\n\n";
          
          if(isset(
      $test) <> "")    
          
      mysql_query("INSERT INTO playlist (test) VALUES ('$test') 
      WHERE id = 
      $id[$j]")

          or die(
      mysql_error().'<hr />'.'INSERT INTO playlist (test) VALUES 
      ($test) WHERE id = $id[$j]'
      .'<hr />');
      }

      echo 
      "<form action=\"$PHP_SELF\" method=\"post\">";

      for(
      $i=1;$i<3;$i++) {
       echo 
      "

       <table align=center>
        <tr>
         <td valign=top>test:</td>
        </tr>
        <tr>
         <td><input type=text name=test></td>
        </tr>
       </table>
      "
      ;
      }
      echo 
      "<center><input type=submit value=Eintragen> <input type=reset value=Löschen></form></center>"

      folgende Fehlermeldung erscheint nun....

      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 'WHERE id = 1' at line 1
      --------------------------------------------------------------------------------
      INSERT INTO playlist (test) VALUES ($test) WHERE id = $id[$j]

      ^^ woran kann das liegen?

      Comment


      • #18
        code umbrechen!

        Comment


        • #19
          nimma beim die() die hochkommata raus, dann siehst du es evtl.

          Comment

          Working...
          X