i have to compare 4 different dates from 4 different tables. i know how to do queries but dont know how to compare those dates. after all i have to display the biggest date. help please!
Use mktime() to generate a timestamp then use the timestamps to order the dates.
Mark.
can you tell me just how to compare those 4 different dates? i mean, what is the code for comparing a few numbers?
something like
$number_i_need = $find_the_biggest_number ($date1, $date2, $date3, $date4);
echo $number_i_need;
thanks!
one suggestion:
you can store the dates in an array and use the sort() or rsort() function to sort it then just get the last/first element in the array. you might have to convert the dates into some sort of timestamp first.
IF you're looking to just return one date from the query, try doing the comparison in the query itself. Check out http://www.mysql.com/doc/en/Date_and_time_functions.html for info on MySQL Date Time functions (assuming you're using MySQL).