[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-db
Subject:    RE: [PHP-DB] SELECT
From:       "Bastien Koert" <bastien_k () hotmail ! com>
Date:       2006-01-20 14:03:20
Message-ID: BAY106-F31679E1943A0E63AAB2229D1F0 () phx ! gbl
[Download RAW message or body]

Convert both to unix timestamps...be much easier to wrok with both date and 
time then

bastien


>From: "Ron Piggott (PHP)" <ron.php@actsministries.org>
>Reply-To: ron.php@actsministries.org
>To: PHP DB <php-db@lists.php.net>
>Subject: [PHP-DB] SELECT
>Date: Fri, 20 Jan 2006 06:00:33 -0500
>
>Yesterday I asked how to get the date & time 90 minutes ago and I
>received several responses.  Thanks.
>
>I don't think this select statement is working "correctly".  (Correctly
>being what I am intending it to do)
>
>I took a look at the table this morning.  One record remains that was
>created 2006-01-19 at 23:55:37.  These are the values of date_created
>and time_created.  The current values are approximately 2006-01-20 and
>05:50:00
>
>This is the select statement I am writing about:
>
>SELECT * FROM `table` WHERE `date_created` <= '$date_90_minutes_ago' AND
>`time_created` <= '$time_90_minutes_ago'
>
>Intellectually I know the problem: 05:50:00 is much earlier than
>23:55:37 ... thus my AND is not allowing both conditions to exist
>together.
>
>Is there a way that I may modify this SELECT statement so the present
>conditions continue to exist and add a second part to the SELECT
>statement that if the time is 01:30:00 or higher that records from the
>previous day are selected?  This continues to allow the 90 minute time
>frame for users logged into my web site ... I am not sure how you would
>add an OR function to the above without messing up what presently
>works :)
>
>(I am writing a SESSION function for my web site using mySQL and a cron.
>The select statement I quoted above is part of the cron.)
>
>Ron
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic