You are here: current_date()-1 misbehaving on first day of month « PHP Programming Language « IT news, forums, messages
current_date()-1 misbehaving on first day of month

Posted by toedipper on 11/03/05 00:48

Hello,

PHP and mysql

I have the following select statement whch gives me a count for
downloads for previous day.

SELECT
COUNT(swid)
FROM
downloads
WHERE
date = current_date()-1

This works on every day of the month except the 1st day....so on 1st
November my values for 31 Oct showed 0 even though elsewhere I could see
that there was activity. It was the same on 1 Oct for 30th Sept and
will be no doubt the same on 1st Dec for 30 Nov.

Any ideas on why it shows zero? Does current_date()-1 have problems
when it's the first day of month?

Thanks,

td.


Great news!
Cure found for Bird Flu!
http://www.pocketpcheaven.com/birdflue.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация