Quick one here, I'm trying to select all the records between two timestamps. The current time and the date Accepted. The Date Accepted is a UNIX timestamp. I am trying to select the records from a table called "messages" and the UNIX timestamp for each record is in the "time" column.
This is one of the queries I've tried
$query = " SELECT * FROM `messages` WHERE `user_id` = $id \n"
. "And `time` between \"(UNIX_TIMESTAMP($timestamp)\" And UNIX_TIMESTAMP(NOW()) ";
It doesn't seem to be returning anything for me. I've tried so many different variations. I have also tried this - $timestamp is in Unix format..
$query = " SELECT * FROM `messages` WHERE `user_id` = $id \n"
. "And `time` between $timestamp And UNIX_TIMESTAMP(now()) ";
I'm sure it's something glaringly obvious, would much appreciate some input!