Php Datum Problem - Bin AnfÄnger

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

  • Php Datum Problem - Bin AnfÄnger

    hallo bin anfänger und habe da ein problem

    möchte ein kleines gästebuch programieren wie bekomme ich das datum des eintrages in die ausgabe seite ????

    z.b. so : Freitag, 21 Januar 2005 um 18:09 Uhr

    wer sich den salat mal anschauen möchte :

    http://www.nolimits-hh.de/php/ausgabe.php

    und für die eingabe :

    http://www.nolimits-hh.de/php/eingabe.php

    /danke für eure hilfe :-)

    QUELLTEXT FÜR DIE eingabe.php:


    <?php
    $now = time();
    if (isset ($gesendet))
    {

    mysql_connect("localhost", "xxxxx", "xxxxx");
    mysql_select_db("xxxxx");

    $sqlab = "insert board";
    $sqlab .= "(email, datum, nachricht) values ";
    $sqlab .= "('$em' , '$now' , '$na')";

    mysql_query($sqlab);
    }

    QUELLTEXT FÜR DIE ausgabe.php:

    <?php
    mysql_connect("localhost", "xxxxx", "xxxxx");
    mysql_select_db("xxxxx");
    $res = mysql_query("select * from board");
    $num = mysql_num_rows($res);

    while ($dsatz = mysql_fetch_assoc($res))

    {

    echo "<tr>";
    echo " <td>" . $dsatz["datum"] . "</td>";
    echo "</tr>";

    }
    Zuletzt geändert von mikeHH; 21.01.2005, 19:21.

  • #2
    lesen!
    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 |


    Kommentar


    • #3
      guck doch mal da:

      http://www.dynamic-webpages.de/php/function.date.php

      Kommentar


      • #4
        Das Datum würde ich in ein DATETIME-Feld in die Datenbank schreiben (und nicht den normalen Unix-Timestamp).
        Um den Wochentag bzw. Monat auf Deutsch zu kriegen musst du dir noch was einfallen lassen - z.B. mit einem Array.
        PHP-Code:
        Array( 'Montag',
               
        'Dienstag',
               
        'Mittwoch',
               
        'Donnerstag',
               
        'Feiertag',
               
        'Sonnabend',
               
        'Sonntag'); 
        hopka.net!

        Kommentar

        Lädt...
        X