September 30th, 1999, 05:48 AM
I have created a table with the following column:
this would mean then whenever i insert or update a row in this table the
datetime field automatically gets the value of the current date/time
this is correct right ?
i insert data to the database with a form and as the TIMESTAMP value I
but whenever i try to pull the data back out with fethrow or fetcharry and
display it all i get is 14 zero's... like this: 00000000000000
does anybody got an idea what is going on or what i'm doing wrong ?
if requested i can place the code here if that might be helpful...
i'm running the windows versions of php3/mysql on PWS (for testing purposes)
i'm sort of new to all this so a clear response is appreciated...
September 30th, 1999, 03:15 PM
I've found this particular feature of mysql very unreliable (Glad to hear I'm not the only one.)
I've taken to using a unix timestamp from PHP and inserting that manually.
September 30th, 1999, 10:50 PM
I could be wrong- I think if you set the default value of the timestamp field to null then it's automatically set to 0, then you have to change the value from the default if you want it to be different.
When I insert/update I set the value of timestamp field to NOW().
i.e. UPDATE table SET timestamp=NOW()
You can check out the mysql manuals on devshed to learn more about timestamp.
October 1st, 1999, 08:18 AM
You are. Wrong, that is
Setting a timestamp field to null is "supposed" to set it to current time. It is also supposed to update if ANY changes are made to the record, whether or not the timestamp field is specifically accessed or not.