Results 1 to 4 of 4

Thread: Second to First Row instead of first...

  1. #1
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default Second to First Row instead of first...

    I have logs of all the times users log in and out on my site for security reasons. It logs time, date, IPA, for that specific user. I want to display the second to first time *the time before the user logged in* So it would display:
    You last logged in at 25:00 on the night of the 32nd lol...
    I don't know how to do this using SQL from that specific page...
    Thanks for the help
    Last edited by Rockonmetal; 04-02-2008 at 02:45 AM. Reason: I forgot to say thanks up front

  2. #2
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    What programming language are you using. PHP, ASP, etc.
    Ryan
    Sevierville, TN

  3. #3
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    I am using php...

  4. #4
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    Heres a sample of one way you can do it.

    PHP Code:
    <?php
    include 'include/config.php';
    include 
    'include/opendb.php';

    $sql mysql_query("SELECT * FROM logs WHERE uid = CONVERT(_utf8 '$uid' USING latin1) COLLATE latin1_swedish_ci order by uid"); 

    $q=mysql_fetch_array($sql);

    $time=$q['time'];
    $day=$q['day'];

    echo 
    "You last logged in at $time on the night of the $day";
    ?>
    Ryan
    Sevierville, TN

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
  •