Hilfe kann keine Tabelle erstellen

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

  • #16
    was gibt dir denn die zeile für ne fehlermeldung: mysql_query($insert,$db) or mysql_error();
    Ich denke, also bin ich. - Einige sind trotzdem...

    Comment


    • #17
      das ID-feld muss das autoincrement haben, nicht der namen.
      INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


      Comment


      • #18
        Keine fehlermeldung nach mysqlerror()
        ich glaub ich muss die tabelle noch mal überdenken oder ich hab doch garkein ID feld hmm wei mach ich das jetzt nur
        Danke noch mal für die vielen Tip´s bin schon weiter wie gestern ich kann eine tabelle erstellen
        Vornehm geht die Welt zugrunde

        Comment


        • #19
          PHP Code:
          $sql="CREATE TABLE ".$tabellenname." (
            id int(11) NOT NULL auto_increment,
            name text NOT NULL default '',
            mail varchar(50) NOT NULL default '',
            eintrag text NOT NULL default '',
            PRIMARY KEY  (id)
          )"

          INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


          Comment


          • #20
            Danke,
            aber in die tabelle schreibt er es troztdem nichts rein muss ich jetzt was am INSERT INTO code ändern wegen der ID??
            Vornehm geht die Welt zugrunde

            Comment


            • #21
              nein. das schreibt er automatisch.
              INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


              Comment


              • #22
                hmmm,
                dann mach ich immer noch was falsch es werden einfach keine daten gespeichert sagt zwar ok aber nix drin
                muss ich die Formularfelder vorher noch mal überprüfen ob es auch in die tab passt oder reicht der code so??
                Vornehm geht die Welt zugrunde

                Comment


                • #23
                  ich hab es rausgefunden man sollte schon mit im INSERT auch die ID mit angeben also so
                  PHP Code:
                  $insert "INSERT INTO `Tabelle` (`id`, `name`, `mail`, `eintrag`) VALUES ('','$name', '$email', '$eintrag')"
                  dann funct es danke nochmal für eure HILFE
                  Vornehm geht die Welt zugrunde

                  Comment


                  • #24
                    schon richtig, aber man MUSS NICHT unbedingt die id als feld angeben.
                    kann sein, dass die ` schlud dran sind.
                    teste das mal so. so mache ich das zumindest und funktioniert einwandfrei.

                    PHP Code:
                    $insert "INSERT INTO Tabelle (name, mail, eintrag) VALUES ('".$name."', '".$email."', '".$eintrag."')"
                    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                    Comment


                    • #25
                      Danke werd ich mal ausprobieren??
                      Wie läuft das eigentlich mit datum in mysql
                      bei mir stehen immer nur nullen da auser bei der Uhrzeit das hab ich schon hin bekommen aber der tag!!!
                      Vornehm geht die Welt zugrunde

                      Comment


                      • #26
                        wenn das feld vom typ DATETIME ist kannst du so das aktuelle datum reinschreiben.

                        Code:
                        INSERT INTO tabelle (datumsfeld) VALUES (NOW());
                        wenn du ein anderes datum incl. uhrzeit da reinschreiben willst, kannst du das so machen.

                        Code:
                        INSERT INTO tabelle (datumsfeld) VALUES ('2003-01-23 17:32:45');
                        das feld kannst du logischerweise bei INSERT usw. mit anderen feldern kombinieren.

                        PHP Code:
                        $insert "INSERT INTO Tabelle (name, mail, eintrag, datumsfeld) VALUES ('".$name."', '".$email."', '".$eintrag."', NOW())"
                        EDIT:
                        NOW() ist eine mysql-funktion, die das aktuelle datum liefert.

                        6.3.4 Date and Time Functions

                        INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                        Comment


                        • #27
                          danke für den tip!
                          so das gb läuft DANKE,
                          jetz muss ich mir nur noch was zur ausgabe einfallen lassen denn alles untereinander sieht etwas komisch aus
                          Vornehm geht die Welt zugrunde

                          Comment


                          • #28
                            OffTopic:
                            mache es doch mal aussergewöhnlich .... diagonal im quadrat. davon der sinus und mal pi. sieht bestimmt lustig aus.


                            mal im ernst. warum nicht untereinander?
                            INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                            Comment


                            • #29
                              darum, klick mal hier sieht doch etwas blöd aus oder abe mit pi das wär mal was

                              hehe
                              Vornehm geht die Welt zugrunde

                              Comment


                              • #30
                                logisch. man muss es ja auch noch formatieren .... take a look

                                aber der standard ist nunmal untereinander.
                                INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                                Comment

                                Working...
                                X