|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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????
|
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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....
|
|
#4
|
||||
|
||||
|
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 |
|
#5
|
|||
|
|||
|
Re: Ummm...
Quote:
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. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Storing dates.... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|