I may be gravely mistaken here, but - the NOW() function will return a value such as 2008-11-11 12:45:34 - which does not compare favourably to a Unix 'epoch time' timestamp such as "1375318861".
Not sure what would be the most efficient, but you could try changing either of the values to the other format:
FROM_UNIXTIME(starts) and FROM_UNIXTIME(ends)
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
I try and I will tell you...
Originally Posted by SimonJM
I can't belive there is no php TIME() equivalent in MySQL...
please do believe it
Originally Posted by =charlie=
it is called UNIX_TIMESTAMP() --notice, no parameter in the function call
the start and end columns should be INTEGER and not VARCHAR, but luckily for you, mysql will convert automatically
please, try this --
as for the LIMIT 6 that i saw, i'm going to pretend i never saw that
BY CASE WHEN starts < UNIX_TIMESTAMP()
AND ends > UNIX_TIMESTAMP() -- in progress
WHEN starts > UNIX_TIMESTAMP() -- future auction
ELSE 3 -- terminate
July 11th, 2013, 08:53 AM
OK, IT'S WORKING!
Thanks to all!