jaydeesmalls Posted December 11, 2008 Share Posted December 11, 2008 Hi all, I have this $date=date('Y-m-d'); $time=time('NOW()'); $query="INSERT INTO $tbl_name (date, time, product, phoneline, question, answer, metatags) VALUES ('$date', '$time', '$product', '$phoneline', '$question', '$answer', '$metatags')"; $result=mysql_query($query); And all the fields work except for time. The field type in the table is "TIME", but all I get is 00:00:00. Any suggestions? Thank you Quote Link to comment https://forums.phpfreaks.com/topic/136494-solved-problem-with-capturing-time/ Share on other sites More sharing options...
trq Posted December 11, 2008 Share Posted December 11, 2008 Firstly, your passing an arument to time, it doesn't except any. Secondly, time returns a unix tiestamp so you'll need to change your mysql field type accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/136494-solved-problem-with-capturing-time/#findComment-712479 Share on other sites More sharing options...
jaydeesmalls Posted December 11, 2008 Author Share Posted December 11, 2008 thank you Thorpe. Unfortunately, I've very much new to this, and don't fully understand. Would you (or someone else) mind to further explain. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/136494-solved-problem-with-capturing-time/#findComment-712540 Share on other sites More sharing options...
jaydeesmalls Posted December 11, 2008 Author Share Posted December 11, 2008 I googled what you put in, and figured it out. Thank you Thorpe! Quote Link to comment https://forums.phpfreaks.com/topic/136494-solved-problem-with-capturing-time/#findComment-712578 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.