date_format Problem

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

  • #16
    Kannst du mir das mit srtotime mal an einem beispiel zeigen?
    Kannst du mir bitte zeigen wie ich das Manual lesen soll ??? Ich habe dir die Fkt doch extra auf's Manual verlinkt. Mehr als ein Klick ist das nicht.
    Wenn ich >= mache bekomm ich doch auch die daten die später sind als das was ich will oder nicht?
    Ich hatte dich so verstanden, dass du alle Termine willst, die noch in Zukunft (vom Timestamp her betrachtet) liegen. Oder willst du nur jene, die genau an diesem Datum stattfinden ?

    Gruss

    tobi
    Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

    [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
    Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

    Kommentar


    • #17
      Ja genau ich will nur den an dem datum, ich brauche also in der where abfrage einen wert in format 0000-00-00.
      Nicht im Format 0000-00-00 00:00 . Deswegen die Frage zu dem split

      Kommentar


      • #18
        Probier mal dies
        PHP-Code:
        $sql "SELECT * FROM veranstaltungen WHERE DATE(stamp) = $partyday"
        k.A. ob das funzt, aber probieren schadet ja nix.

        Gruss

        tobi
        Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

        [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
        Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

        Kommentar


        • #19
          Das kann ja auch nicht klappen weils ein DATETIME Feld ist
          aber mit datetime gehts auch nicht. Mein einziges Problem ist das ich nicht weiss wie ich das datum aus dem datetime in der mysql abfrage filtern kann, weil ich zu doof bin mir die englischen manuals zu checken

          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 '(stamp) = '2006-10-27'' at line 3

          Hab es gelöst, zwar extrem banal aber ich kann damit arbeiten

          WHERE stamp >= \"$year-$month-$day 00:00:00\" AND stamp <= \"$year-$month-$day 23:59:59\"
          Zuletzt geändert von analyzer; 24.10.2006, 11:43.

          Kommentar


          • #20
            So geht's natürlich auch
            Folgendes würde dir noch ein paar wenige Zeichen einsparen
            PHP-Code:
            $sql "... WHERE stamp BETWEEN '".$year.$month.$day." 00:00:00' AND '".$year.$month.$day." 23:59:59'"
            Gruss

            tobi
            Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

            [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
            Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

            Kommentar

            Lädt...
            X