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 Link to comment https://forums.phpfreaks.com/topic/18116-date/ 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 Link to comment https://forums.phpfreaks.com/topic/18116-date/#findComment-77632 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. Link to comment https://forums.phpfreaks.com/topic/18116-date/#findComment-77635 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 Link to comment https://forums.phpfreaks.com/topic/18116-date/#findComment-77643 Share on other sites More sharing options...
redarrow Posted August 20, 2006 Share Posted August 20, 2006 use in the database INT ok. Link to comment https://forums.phpfreaks.com/topic/18116-date/#findComment-77645 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. Link to comment https://forums.phpfreaks.com/topic/18116-date/#findComment-77649 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 Link to comment https://forums.phpfreaks.com/topic/18116-date/#findComment-77682 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.