Results 1 to 2 of 2

Thread: Retrieve data using unix timestamp

  1. #1

    Retrieve data using unix timestamp

    I am using PHP and have a login form that creates a unix timestamp.

    I would like to display a list of users that has logged in today.

    How do I identify the date only from the unix timestamp and then use either sql or php to retrieve that data?

  2. #2
    PHP Code:
    <?php
        $start 
    strtotime('Today 00:00:00');
        
    $end strtotime('Today 23:59:59');

        
    $query sprintf('SELECT * FROM `table` WHERE `timestamp` >= %d AND `timestamp` <= %d ',$start,$end);
        
    $result mysql_query($query) or die(mysql_error());
    ?>
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012