I have a simple script that pulls information including dates stored in the DATE format in a mysql database. I know that using PHP I am going to have to convert them using the UNIX_TIMESTAMP() mysql function but I can't seem to get it to work no matter what I try. When I do think I have the syntax correct it only outputs "Resource Id#2". The code I am using is...
$query = "SELECT UNIX_TIMESTAMP(when) from filter";
$result = mysql_query($query);
print ("<p>$result</p>\n");
The field "when" is where the dates are stored. I want to convert it to a timestamp so I can do date subtraction pull entries where the date field entry is 6 months or older. The version of mysql on my server is 4.1.21-standard.
Thanks!
Rich S.