Hello,
what I want is to check if the date coimg from mysql is equal to or less than the current date.
here is my code
<?
$tmp=time();
$date=date("Y-m-d",$tmp);
$sql="SELECT * FROM table_name WHERE issuedate <= '$date' ORDER BY issuedate DESC LIMIT 1";
?>
so that the latest article will be displayed .
The issuedate column is of type date ie YYYY-mm-dd
so if the issuedates in the table are say
2002-08-30 and 2002-08-23,till 29th aug article of issudate 23rd aug and on 30th aug the article of issuedate 2002-08-30 shd get displayed
I am having a problem with the date comparison with the above query..
what is the mistake i have made there ?
Thanks in advance
spookie
[/color] --------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
what I want is to check if the date coimg from mysql is equal to or less than the current date.
here is my code
<?
$tmp=time();
$date=date("Y-m-d",$tmp);
$sql="SELECT * FROM table_name WHERE issuedate <= '$date' ORDER BY issuedate DESC LIMIT 1";
?>
so that the latest article will be displayed .
The issuedate column is of type date ie YYYY-mm-dd
so if the issuedates in the table are say
2002-08-30 and 2002-08-23,till 29th aug article of issudate 23rd aug and on 30th aug the article of issuedate 2002-08-30 shd get displayed
I am having a problem with the date comparison with the above query..
what is the mistake i have made there ?
Thanks in advance
spookie
[/color] --------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.