I have a column in a table that is of the DATETIME type. And whenever a record is inserted, that DATETIME column is assigned NOW() within the INSERT query.
I am now writing a script that should be able to determine if one record in this table was created before or after another record by using the DATETIME column.
For instance:
Code: Select all
if ($row1['date_entered'] > $row2['date_entered'])
Problem is, it doesn't seem to be working. It seems as though you can't compare DATETIME values (ie NOW() values) together. Can you? If not, what is a simple solution to this problem so I can compare two DATETIME values and see which is the earlier record. Thanks so much for your help.