General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 24th, 2003, 06:50 PM
Zionblade Zionblade is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: VA
Posts: 3 Zionblade User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Zionblade
Unhappy Storing dates....

I need to know how to make my counter store the exact time.. year, date, hour, minute, and second.. in php. Anyone have any ideas on how to store this info into my database????

Reply With Quote
  #2  
Old March 24th, 2003, 06:54 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Create a field in your database table with a TIMESTAMP field.

A timestamp is a string which holds the time and date in the following format

YYYYMMDDHHMMSS

Reply With Quote
  #3  
Old March 24th, 2003, 06:58 PM
Zionblade Zionblade is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: VA
Posts: 3 Zionblade User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Zionblade
Ummm...

but how do you make the script grab the time that its started and put it in the table .... i want to know when the people visit my site....

Reply With Quote
  #4  
Old March 24th, 2003, 10:29 PM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 233 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 50 m 19 sec
Reputation Power: 6
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
when you insert into the table just have the timestamp column listed as one of the coulmns and the time should og in automatically
__________________
CHornJr
"One day I'll know what I am doing"
My Blog
Suanhacky Lodge #49
Rebel Squadrons

Reply With Quote
  #5  
Old March 24th, 2003, 11:35 PM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
Re: Ummm...

Quote:
Originally posted by Zionblade
but how do you make the script grab the time that its started and put it in the table .... i want to know when the people visit my site....


if you have these columns in your table:

"names"
Id
Name
DateUpdated

then your insert may look like this:

insert into names (`Name`) values ("test");

Notice I did not insert into Id or DateUpdated, because I'd assume that Id is an auto_increment and DateUpdated being a timestamp gets the current date/time if no value is specified.

This also works when you do an update... it will automatically get the new time of update.

Beware, the update only happens on the first occurance of a timestamp in each table, so if you have two timestamps, on the first one will get auto updated.
__________________
__________________________________________________ _
Wil Moore III, MCP | Integrations Specialist | Senior Consultant
Are You Listed...? | DigitallySmooth Inc.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Storing dates....


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway