SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: age?

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    shropshire, west midlands, UK
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    age?

    I have made a script that will tell me how long the members have been signed up for, with the help of someonewhois. I get the following error:Parse error: parse error in /home/sites/site201/web/age.php on line 13.
    Heres the code:
    PHP Code:
    <?php

    // create connection
    $connection mysql_connect("localhost","mech","*****")
        or die(
    "Couldn't make connection.");

    // select database
    $db mysql_select_db("mech"$connection)
        or die(
    "Couldn't select database.");

    $register mysql_query("SELECT date FROM user WHERE fullname = $username");

    $current "date("Y-m-d");

    $age = $current - $register;

    echo "
    $age";
    ?>
    Hopefully you can see the problem. If n e one has a better way of doing it, please tell me the code as it may save me some time. Thanx in advance guys.

  2. #2
    And your point is.... redgoals's Avatar
    Join Date
    Feb 2002
    Location
    Birmingham, UK
    Posts
    496
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $current "date('Y-m-d')"
    http://redgoals.com ... my site ... nuff said

  3. #3
    SitePoint Wizard Chris82's Avatar
    Join Date
    Mar 2002
    Location
    Osnabrück
    Posts
    1,003
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $current = date("Y-m-d", time());

  4. #4
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what redgoalds said should work!

    I told you that would work, venom!

    I just forgot the quoote...

  5. #5
    SitePoint Zealot Nate's Avatar
    Join Date
    Sep 2001
    Location
    BC, Canada
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whats the advantage to including the ', time()' portion of the date function, if you are not going to modify it? Does it slow it down not to?
    NATHAN WRIGHT
    PHP Developer, Simple Station


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •