PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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, 06: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, 04: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, 11: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, 09: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


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




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek