timestamp help
Well im trying to create a kind of community type website and have designed the database to insert a date everytime someone registers.
Im getting a little confused as to weather i should use a date field or int field and should i use the date() function or the mktime() function???
Basically one reason i want to insert a date is because i want to show the latest registered users on the front page. So i some how need to loop through the dates starting from the present back to a weeks time??? If that makes sense, im also struggling on how this could be done.
Im quite new to dates and times. Any help appreciated.
kb posted this at 19:39 — 10th July 2007.
He has: 1,380 posts
Joined: Feb 2002
For the datatbase, you can use "time" for the time and "date" for the date....
As for how you get those values, you can use either time or date for "date" [it involves some conversions either way] and you can use time for "time" [still probably some formatting conversions... it depends on your database choice, I think]
kb posted this at 19:40 — 10th July 2007.
He has: 1,380 posts
Joined: Feb 2002
Oh, and as a side note...
For how to register their new login... when the login is processed, just update the date and time fields. And then pull those values onto whatever page you want to show them on... it's pretty simple!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.