Re: storing months in mysql 4



laredotorn...@xxxxxxxxxxx wrote:
>
> I'm using PHP 4 and MySQL 4. I want to store the month and
> year as a single row but I am having difficulty figuring out
> the best data type to use.

The best for WHAT? How do you intend to use the data? What
typical computations will be performed on it? What will it
be routinely compared to?

> I suppose I could use 'DATE' and then always have the day
> value be equal fto 1, but I figure there's a more elegant
> approach.

Again, depends on how you are going to use the data. Maybe
for your purposes it makes more sense to set the date to the
last day of the month...

Cheers,
NC

.



Relevant Pages

  • email attachments
    ... PHP that will do the following. ... Store the attachments and message in a mySQL ... and store them in the database. ...
    (alt.php)
  • Re: storing months in mysql 4
    ... I'm using PHP 4 and MySQL 4. ... I want to store the month and year ... >as a single row but I am having difficulty figuring out the best data ...
    (comp.lang.php)
  • Re: [PHP] PHP and MySQL date
    ... If you need to store both date and time, there are several ways to accomplish this. ... MySQL has built-in date/timestamp options, but those long strings would need to be converted for be human readable. ... The option I use most is telling PHP what format I want to use and entering it into the database as a variable character field. ...
    (php.general)
  • Re: FAQ time?
    ... we should store it in mysql and use php to ... > generate the FAQ posts. ...
    (comp.lang.php)
  • storing months in mysql 4
    ... I'm using PHP 4 and MySQL 4. ... I want to store the month and year ... as a single row but I am having difficulty figuring out the best data ...
    (comp.lang.php)