Thak you for your replies.
NogDog,
No, the table is not empty. I wrote this query in my previous post just to make things not so complicated for forum readers.
The real query is:
$check= mysql_query( "SELECT id, title, arttext, mydate FROM articles order by id DESC limit $start, $step");
while(list($aid, $title, $arttext, $mydate) = mysql_fetch_row($check)) {
}
field "mydate" contains time information when article vill be available for reading - it's always in the future.
I wrote to the DB some 20 test articles with publication time in 5-10-15-20 minutes.
First I noticed this problem in this situation:
$time = time();
if ($mydate < $time) {
echo "Article published";
} else {
echo "Article not published yet";
}
It looked strange to me that all test articles appared as published. That's why I used the date function to check the date and time. I submitted all tests with different values of minutes - 15, 17, 20, 25, 35, but date function returns only 3 values - 05 or 06 or 07.
Drakla, I don't understand why "Y-m-d HⓂs" should be a problem.