Only show certain items in a mysql database using php and time()
Posted
by Jon
on Stack Overflow
See other posts from Stack Overflow
or by Jon
Published on 2010-06-03T03:07:09Z
Indexed on
2010/06/03
3:14 UTC
Read the original article
Hit count: 199
Is there a way to only show the items that are older than a certain date in a php mysql array? I'm using this query method and sorting by lastpost_cl:
$query="SELECT * FROM properties ORDER BY lastpost_cl";
$result=mysql_query($query);
$num = mysql_num_rows ($result);
mysql_close();
and I was thinking the way of checking the time would be:
if (time() <= strtotime($lastpost_cl)) {
}
How can I combine the two and only show lastpost_cl that are older that the current time?
© Stack Overflow or respective owner