[thelist] PHP/SQL storing year strangely

John Kipling Lewis jklewis at umich.edu
Fri Feb 22 14:12:01 CST 2002


On Fri, 22 Feb 2002 NanHarbisonSmith at aol.com wrote:

> --
> [ Picked text/plain from multipart/alternative ]
> 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?

tinyint ranges from -128 to +127.  It's giving the highest number it can
for the field.

John -




More information about the thelist mailing list