[thelist] PHP/SQL storing year strangely

NanHarbisonSmith at aol.com NanHarbisonSmith at aol.com
Fri Feb 22 14:29:00 CST 2002


--
[ Picked text/plain from multipart/alternative ]
Obviously, I just got the answer to my question in another post, but I was
putting the year in a separate field so that I can use it to send the pdf
file to the correct folder. In the minutes folder is the folder called 2002,
and when 2003 rolls around the program will create a folder called 2003 and
then put all the minutes for 2003 in that folder, etc. I know I could have
parsed it out of a date field, but this was so easy.

Now that I have figured out how to code for uploading the files for 2002, I
am working on the function to create the folder for the next year...
This is a small school district, we only get about 100 hits a day on the
website, but would it have saved me a lot of overhead to parse the year out
of the date instead of creating a separate field for the year? Other
considerations, there are only 2-3 school committee meetings a month, so the
database won't be taxed too much, I don't think. And I created a very simple
hit counter (just for my own benefit) that tells me in the last 3 weeks, the
school committee minutes page has only received 34 hits. (<A HREF="http://www.colonial.net/page_counter.php">
http://www.colonial.net/page_counter.php</A>)
Thanks for your advice,
Nan

In a message dated 2/22/2002 3:14:42 PM Eastern Standard Time,
nonzero at well.com writes:


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Most databases have special Date datatypes, you really should use
> those instead.
> - ----- Original Message -----
> From: <NanHarbisonSmith at aol.com>
> > I am working on an area of a school district website where school
> > committee minutes from meetings will be uploaded by an
> > admin/secretary in pdf format. On the form where this happens, I
> > have the date and the meeting type as drop down boxes (so that
> > fewer typos will occur here, maybe this is a good tip, to use drop
> > down boxes when the choices are finite). I had the year field as a
> > tinyint, since it is 4 digits long. The year showed up correctly
> > everywhere except the way it was stored in the database. The year
> > 2002 turned up in the database as 127 every time. I changed the
> > data type to varchar, and that works fine. But can someone tell me
> > what was going on there with the integer?
>


Nan Harbison Smith
481 Elm Street
Concord, MA 01742
978-369-1224
978-369-1681

Give a man a fish and you feed him for a day; teach him
to use the Internet and he won't bother you for weeks.





More information about the thelist mailing list