Results 1 to 2 of 2

Thread: PHP / MYSQL Epoch Date Between

  1. #1
    Join Date
    Jul 2007
    Location
    Irmo, SC
    Posts
    96
    Thanks
    10
    Thanked 7 Times in 7 Posts

    Default PHP / MYSQL Epoch Date Between

    I am working on a project that involves an order table. This table has a DatePlaced column on it stored as an INT. This is populated using time() which is the epoch time in seconds from x etc.

    I need to be able to select all orders where the DatePlaced between y and z. Y and Z will be form elements from html/php. What fomatting/conversion do I need to do to get mysql to understand what I am looking for?

    This is super easy in oracle, I am hoping there is an easy solution in mysql

    Thanks in advance

  2. #2
    Join Date
    Jul 2007
    Location
    Irmo, SC
    Posts
    96
    Thanks
    10
    Thanked 7 Times in 7 Posts

    Default

    think I got it figured out.


    $from = strtotime($_POST["datefrom"]);
    $to = strtotime($_POST["dateto"]);
    $parse.=" where DatePlaced BETWEEN ".$from." and ".$to." ";

    I am actually building the parse query string based on different determinants being supplied by the user. It seems to be working though.

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
  •