SQL-Update mit PHP

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • SQL-Update mit PHP

    Also, mal wieder mein Formular ...

    ich hab alle Felder ausgefüllt, auch überprüft ob sie ausgefüllt sind und sende den ganzem Quatsch an mein Script ..

    Soweit, sogut ...

    Nun die SQL-Anweisung :

    PHP-Code:
    $sql "UPDATE $news_table SET title= '$subject', text = '$message', ";
    $sql .= "importance = '$importance', enable_sig = '$attach_sig',";
    $sql .= "disable_bbcode = '$disable_bbcode', disable_smiles = '$disable_smiles'";
    $sql .= "WHERE id = '$id'";
    $result mysql_query($sql); 
    Nur irgendwie trägt er nichts in die DB ein ....

    DB ist ausgewählt, $news_table ist die richtige Tabelle ...

    ne Idee ???

    mfg DaPhreak
    If something's HARD to do,

    then it's not worth doing.
    (Homer J. (Jay) Simpson)

  • #2
    Was sagt denn:
    PHP-Code:
    if (!$result=mysql_query($sql)) die (mysql_error()); 

    Kommentar


    • #3
      Bloß da kommt nix von wegen mysql_error() ....

      supi ...

      mfg DaPhreak
      Zuletzt geändert von DaPhreak; 22.05.2002, 16:02.
      If something's HARD to do,

      then it's not worth doing.
      (Homer J. (Jay) Simpson)

      Kommentar


      • #4
        Also wenn kein Mysql_error kommt dann stimmt das sql syntaktisch. Vielleicht gibt es keinen Daten satz mit der id=$id???
        dann erfolgt auch kein update.
        Beantworte nie Threads mit mehr als 15 followups...
        Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

        Kommentar


        • #5
          doch der exestiert ....

          und die URL lautet : news.php?mode=edit&id=1
          If something's HARD to do,

          then it's not worth doing.
          (Homer J. (Jay) Simpson)

          Kommentar


          • #6
            lass Dir mal das sql aus geben.
            Beantworte nie Threads mit mehr als 15 followups...
            Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

            Kommentar


            • #7
              wie meinen ???

              lass dir mal das sql ausgeben
              daphreak
              If something's HARD to do,

              then it's not worth doing.
              (Homer J. (Jay) Simpson)

              Kommentar


              • #8
                Mach mal
                print $sql und teste das im phpmyadmin zB.
                Beantworte nie Threads mit mehr als 15 followups...
                Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

                Kommentar


                • #9
                  aber auch der print kommt nich .....
                  If something's HARD to do,

                  then it's not worth doing.
                  (Homer J. (Jay) Simpson)

                  Kommentar


                  • #10
                    Wat? Wo ist den das $sql???
                    poste mal dein code
                    Beantworte nie Threads mit mehr als 15 followups...
                    Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

                    Kommentar


                    • #11
                      aber klaro ...

                      news.php => $sql

                      edit.inc.php => Formular ..
                      Angehängte Dateien
                      If something's HARD to do,

                      then it's not worth doing.
                      (Homer J. (Jay) Simpson)

                      Kommentar


                      • #12
                        if ($sender1="Änderungen speichern" && $mode="edit"){
                        }

                        Diese if bedingung wird wohl nicht ausgeführt...
                        Btw muss es heissen
                        if ($sender1=="Änderungen speichern" && $mode=="edit"){

                        Check mal $sender1 und $mode auf Ihren Inhalt
                        Beantworte nie Threads mit mehr als 15 followups...
                        Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

                        Kommentar


                        • #13
                          hast ja recht ....

                          es war die if-Bed.

                          @goth (falls er reinschaut)

                          jaja ich weiss ....

                          @ MellowPie :

                          Danke dir ..

                          mfg DaPhreak
                          If something's HARD to do,

                          then it's not worth doing.
                          (Homer J. (Jay) Simpson)

                          Kommentar


                          • #14
                            @ DaPhreak es heisst MelloPie ohne w... tststs
                            Beantworte nie Threads mit mehr als 15 followups...
                            Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

                            Kommentar


                            • #15
                              neues Prob :

                              der Part

                              PHP-Code:
                                  $sql "UPDATE $news_table SET text = '$message', title= '$subject',";
                                  
                              $sql .= "importance = '$importance', enable_sig = '$attach_sig',";
                                  
                              $sql .= "disable_bbcode = '$disable_bbcode', disable_smiles = '$disable_smiles'";
                                  
                              $sql .= "WHERE id = '$id'";
                                  
                              $result mysql_query($sql); 
                              geht nich...
                              aba wieso ??

                              an der If liegt es diesmal nich ....

                              macht er nich ...
                              Zuletzt geändert von DaPhreak; 22.05.2002, 18:29.
                              If something's HARD to do,

                              then it's not worth doing.
                              (Homer J. (Jay) Simpson)

                              Kommentar

                              Lädt...
                              X