kev wood Posted June 4, 2008 Share Posted June 4, 2008 i am trying to store the time inside a mysql db at the moment i am tying to store this using the NOW() function which i was under the impression that this would store the date and the time inside the db but all i keep getting stored inside is 2008. should this function give just the year or should it give the time and date also. Quote Link to comment https://forums.phpfreaks.com/topic/108661-solved-php-time-function/ Share on other sites More sharing options...
homer.favenir Posted June 4, 2008 Share Posted June 4, 2008 now() function returns yyyy-mm-dd hh:mm:ss Quote Link to comment https://forums.phpfreaks.com/topic/108661-solved-php-time-function/#findComment-557224 Share on other sites More sharing options...
GingerRobot Posted June 4, 2008 Share Posted June 4, 2008 I would imagine the field type you're trying to insert into is incorrect. Try changing it to a DATETIME field. Quote Link to comment https://forums.phpfreaks.com/topic/108661-solved-php-time-function/#findComment-557231 Share on other sites More sharing options...
Darklink Posted June 4, 2008 Share Posted June 4, 2008 You have it at INTEGER I think. Change it to VARCHAR(20). Should do the trick. Quote Link to comment https://forums.phpfreaks.com/topic/108661-solved-php-time-function/#findComment-557233 Share on other sites More sharing options...
Zane Posted June 4, 2008 Share Posted June 4, 2008 you need to show us your code and how you are inserting the time. then all the questions of UNIX timestamps and NOW() functions that'll come up later won't be as confusing. but before I decide to tell you about using a UNIX timestamp instead of the NOW() function....we all need to see you current code so you don't mess it up with random lines people are probably going to give you. Quote Link to comment https://forums.phpfreaks.com/topic/108661-solved-php-time-function/#findComment-557237 Share on other sites More sharing options...
kev wood Posted June 4, 2008 Author Share Posted June 4, 2008 just to show you that the NOW() function is not working as it should here is a screen shot of what was in the db after the ode had been run. www.acmeart.co.uk/test/screenshot.jpg i will try changing it to a varchar (20) and see what that produces Quote Link to comment https://forums.phpfreaks.com/topic/108661-solved-php-time-function/#findComment-557246 Share on other sites More sharing options...
kev wood Posted June 4, 2008 Author Share Posted June 4, 2008 it is working now thank you for the replies on this again some of you. and thank the rest of you for your new input. Quote Link to comment https://forums.phpfreaks.com/topic/108661-solved-php-time-function/#findComment-557249 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.