Re: Something wierd with time() and curdate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 31 October 2004 22:45, Bobo Wieland wrote:
> There is something wierd going on over here...
>
> I have a date field, datum, in mysql that I cast to a timestamp and check
> against time(). If the datum value is more than one day old the table finds
> a new random row and sets the datum field to CURDATE(). Now, this has
> worked for two years now, but today the script suddenly finds a new random
> row each time the script is run... 

Would this line have anything to with it? If not, post some concise code (see 
below).

> mysql_data_seek($result, rand(0,$rows));


> I've notice this just after 11 pm today. 
> As I can see from some debugging time() allways returns a higher value than
> the timestamp + 86400... Have I missed something in this script for the
> last couple of years or is there a bug somewhere? Could it have something
> to do with the fact that we turned the time back one hour last night?
>
> This is the code btw:

Please *try* to isolate the problem and post CONCISE code which sufficiently 
illustrates your problem. For example (for this particular problem) if you 
suspect PHP is calculating the dates incorrectly then a few lines of code 
showing the date calculations would be sufficient. If you suspect MySQL is 
the culprit then a single query would be sufficient.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
------------------------------------------
/*
"There are things that are so serious that you can only joke about them"
- Heisenberg
*/

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux