web_master Posted January 18, 2009 Share Posted January 18, 2009 Hi, I got in dBase table columns: year, mont, day Year is INT(4) Month is INT(2) Day is INT(2) <?php $query_return = mysql_query("SELECT * FROM `r_monday` ORDER BY `r_monday_id` DESC"); // Check query if(!$query_return){ print mysql_error(); exit; } // Request query while($request = mysql_fetch_array($query_return)) { $Date = $request['r_monday_year'].". ".$request['r_monday_month']." ".$request['r_monday_day']."." if(date("Ymd") > $Date) { $DatePrint = ""; }elseif(date("Ymd") < $Date) { $DatePrint = "$Date"; } ?> I think I must to convert r_monday_year, r_monday_month, r_monday_day into date format to work this script, but i dont know how can I do this? Thanx for help in advanced T Link to comment https://forums.phpfreaks.com/topic/141329-convert-numbers-into-date/ Share on other sites More sharing options...
Mchl Posted January 18, 2009 Share Posted January 18, 2009 If you're working with dBase, why are you using mysql_query ? Link to comment https://forums.phpfreaks.com/topic/141329-convert-numbers-into-date/#findComment-739692 Share on other sites More sharing options...
web_master Posted January 18, 2009 Author Share Posted January 18, 2009 putting date into database is not a datetime from Dbase - its users choose he choose the year, month and day Link to comment https://forums.phpfreaks.com/topic/141329-convert-numbers-into-date/#findComment-739698 Share on other sites More sharing options...
Mchl Posted January 18, 2009 Share Posted January 18, 2009 Yeah... I was in mood for a joke, but you didn't get it http://en.wikipedia.org/wiki/DBase You should be comparing timestamps. Take a look at strtotime Link to comment https://forums.phpfreaks.com/topic/141329-convert-numbers-into-date/#findComment-739699 Share on other sites More sharing options...
web_master Posted January 18, 2009 Author Share Posted January 18, 2009 Sorry, Dbase is a database, MySQL, SORRRYYYY! Link to comment https://forums.phpfreaks.com/topic/141329-convert-numbers-into-date/#findComment-739714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.