web_master Posted October 10, 2008 Share Posted October 10, 2008 Hi, When visitor enter some text in Form I put the (expire) datetime too into dBase like: 20081010 Mysql table is: id text (TEXT) date_expire (INT) 00000000 datetime (DATETIME) 0000-00-00 00:00:00 in table is `date_expire` Date of expire is equal with a date when put the text into dBase. $query_return = mysql_query( "SELECT * FROM `text` WHERE `date_expire` ... " ); SO, I want to visitors see the text only 15 days. As I see I must convert the date_expire into date and... ??? How can the visitor see the text 15 days from date given in date_expire to next 15 days? thxs in advanced. T Quote Link to comment https://forums.phpfreaks.com/topic/127814-solved-convert-nr-to-date/ Share on other sites More sharing options...
trq Posted October 10, 2008 Share Posted October 10, 2008 Pardon? Quote Link to comment https://forums.phpfreaks.com/topic/127814-solved-convert-nr-to-date/#findComment-661685 Share on other sites More sharing options...
web_master Posted October 10, 2008 Author Share Posted October 10, 2008 Pardon? How can the visitor see the text 15 days from date given in date_expire to next 15 days? Quote Link to comment https://forums.phpfreaks.com/topic/127814-solved-convert-nr-to-date/#findComment-661692 Share on other sites More sharing options...
redarrow Posted October 10, 2008 Share Posted October 10, 2008 look up interval mysql m8........... Quote Link to comment https://forums.phpfreaks.com/topic/127814-solved-convert-nr-to-date/#findComment-661694 Share on other sites More sharing options...
web_master Posted October 10, 2008 Author Share Posted October 10, 2008 look up interval mysql mate........... Hm... is that mean that I can use the datetime (DATETIME) 0000-00-00 00:00:00, and... $query_return = mysql_query( "SELECT * FROM `text` WHERE `datetime` ... " ); Sorry, Im not a best in PHP (and MySQL), so I dont understand clarly... Quote Link to comment https://forums.phpfreaks.com/topic/127814-solved-convert-nr-to-date/#findComment-661708 Share on other sites More sharing options...
Barand Posted October 10, 2008 Share Posted October 10, 2008 How can the visitor see the text 15 days from date given in date_expire to next 15 days? By storing dates as DATE types Quote Link to comment https://forums.phpfreaks.com/topic/127814-solved-convert-nr-to-date/#findComment-661742 Share on other sites More sharing options...
web_master Posted October 10, 2008 Author Share Posted October 10, 2008 hi, thank You all of You for associations, here is the solution for my problem: $query_return = mysql_query( "SELECT * FROM `table` WHERE DATE_ADD(`datetime`, INTERVAL 15 DAY) >= '".date("Y-m-d H:i:s")."' "); In lots of time enough to tell me what do I search on internet for a solution Quote Link to comment https://forums.phpfreaks.com/topic/127814-solved-convert-nr-to-date/#findComment-662072 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.