PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 30th, 1999, 05:48 AM
TheDuke
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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...



Reply With Quote
  #2  
Old September 30th, 1999, 03:15 PM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
  #3  
Old September 30th, 1999, 10:50 PM
zoordaan
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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.

Reply With Quote
  #4  
Old October 1st, 1999, 08:18 AM
rod k
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Timestamp question

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap