onthespot Posted August 20, 2006 Share Posted August 20, 2006 how do i add a date row on my user registration table for my site! i want the date of when they signed up to be stored in the DB and be used on their profiles Quote Link to comment Share on other sites More sharing options...
spelltwister Posted August 20, 2006 Share Posted August 20, 2006 use the time() function and then use the date() function to convert it to something that is more friendlyexample $now = time(); 'put this into the database$joined = date("M j Y", $now); '$now from the database Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 20, 2006 Share Posted August 20, 2006 look up the date function try to understand the timestamp as it's very inportant in programming as you codes become more better ok.good luck. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 20, 2006 Share Posted August 20, 2006 [code]ALTER TABLE tablename ADD datejoined VARCHAR(255) default="";[/code]Or something similar to that.http://mysql.com/doc/refman/5.0/en/alter-table.html Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 20, 2006 Share Posted August 20, 2006 use in the database INT ok. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted August 20, 2006 Share Posted August 20, 2006 It was an example...I would recommend using MySQL's date type. It's the easiest to work with, especially if you are going to be doing ordering or date manipulation.Aside from that, I would go with varchar, because you are able to store a lot of different formats, including php's unix timestamp (which I think is what redarrow is saying to use INT), but you can also use YYYY-MM-DD if you chose, or any other format. Quote Link to comment Share on other sites More sharing options...
onthespot Posted August 20, 2006 Author Share Posted August 20, 2006 ok thankyou, i will do just that Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.