One more thing! Need help with a timestamp

    Date: 01/15/08 (PHP Community)    Keywords: no keywords

    I just need to have a timestamp when someone posts on my husband's football site. (Like how a guestbook has one.) Here's the code I am using for the site where all results are posted, but the time posts the same for every submission.



    mysql_connect("server", "username", "pw") or die("Error: ".mysql_error());
    mysql_select_db("eric") or die("Error: ".mysql_error());
    extract($_POST); 
    $query = "
    INSERT INTO 
       `zones`
    (name, email, game_one)
        VALUES
    ('$name', '$email', '$game_one')";
     
    $insert = mysql_query($query) or die(mysql_error());
    ?>
    mysql_connect("server", "username", "pw") or die("Error: ".mysql_error());
    mysql_select_db("eric") or die("Error: ".mysql_error()); 
    $query = "SELECT * FROM `zones`";
    $result = mysql_query($query);
    while($__row = mysql_fetch_assoc($result)){
        
        echo $__row['name']."
    ";
        echo $__row['email']."
    ";    
        echo $__row['game_one']."
    ";
        echo $today = "Submitted on" ."
    ".date("D M j G:i:s T Y")."

    ";
    }
    ?>



    What do I need to do to change that? Put it on the form before the Submit button?

    Source: http://community.livejournal.com/php/610054.html

« double posting || Zend Platform 3.0.3 Help »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home