|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have created a table with the following column:
datetime TIMESTAMP; 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 insert NULL 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... |
|
#2
|
|||
|
|||
|
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. Rod |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
You are. Wrong, that is URL
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. Rod K |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > Timestamp question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|