You are here: Re: $mydata->StampDate « PHP « IT news, forums, messages
Re: $mydata->StampDate

Posted by John Taylor-Johnston on 06/27/05 07:14

I could just change the field type. But how do you calculate it? I don't
see much to inspire a start. I'm not a full-time coder either. More of a
tinkerer. I don't want someone to do it for me, but need to get my head
around how to do it.
http://ca3.php.net/manual/en/function.strtotime.php
John

Jasper Bryant-Greene wrote:

>John Taylor-Johnston wrote:
>
>
>>I created my own counter. I have a varchar (10) field that resembles a
>>date: 2005-06-26. Now I would like to parse out $mydata->StampDate to
>>find how many hits per day I have had since "2003-08-23". Where do I start?
>>
>> while ($mydata = mysql_fetch_object($news))
>> {
>> }
>>
>>
>
>You can use strtotime() to convert your string date to a PHP date. and
>then calculate it from that.
>
>However, I'd strongly recommend using a real MySQL date field to store
>the date. There's no reason not to, and then you can use MySQL native
>functions to do a lot of the calculation.
>
>Jasper
>
>

 

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

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