Any help is highly appreciated.
Say I have a MySQL database with a timestamp column with the value \"1305590400\", how can I compare that with a PHP variable of say
You don't get results that probably $date
has some time offset and is not equal to 00:00:00
in your timezone.
WHERE timestamp_column BETWEEN '" . strtotime($date) . "' AND '" . strtotime($date, '+1 day') . "'
or to be more precise:
WHERE timestamp_column >= '" . strtotime($date) . "'
AND timestamp_column < '" . strtotime($date, '+1 day') . "'
Simply
SELECT [...] WHERE '$you_var' = date(`timestamp_column`);
MySQL date() function
You could always convert the timestamp to a formatted date.
SELECT FROM_UNIXTIME(1358871753,'%Y %D %M');
Produces: 2013 22nd January