Good day. There is a table of the form
|id| activ | dateTime | ------------------------------ |1 | no-activ | 2012-01-13 01:06:50 | |2 | activ | 2012-01-13 01:06:50 | |3 | activ | 2012-01-13 01:06:50 | |4 | no-activ | 2012-01-13 01:07:50 |
Now 2012-01-13 01:07:00. It is necessary to sort all entries that are less than now and activ
= 'activ' and output all id
. I do this:
"SELECT COUNT(id) FROM `activ` WHERE `dateTime`<LOCALTIME() AND `activ`='activ';"
and displays the number of records suitable for the parameters. But at the same time, if I ask a query like this:
"SELECT `id` FROM `activ` WHERE `dateTime`<LOCALTIME() AND `activ`='activ';"
then nothing comes. Where is the mistake???