WHERE date='$data'
AND date>date();
ORDER BY time DESC
LIMIT 1; ?
Need Help about time difference
Collapse
X
-
Well, if I can save the time as timestamp format but still, I don't have any idea how to highlight the next news?
Leave a comment:
-
This is a bit complicated as idea.
Why not store the date in a timestamp format? Then you can select passed ones, or coming next ones, etc.
Leave a comment:
-
Originally posted by pichiriche View PostSql code ? Post herePHP Code:$result = mysql_query("SELECT * FROM `newsline` WHERE date='$data' order by time asc");
while ($row = mysql_fetch_array($result)) {
echo "<ul style='newsrow'>";
{
echo "<li>".$row['date']." - ".$row['time']." - ".$row['news']."</li>";
}
echo "</ul>";
Last edited by asifnayem; 14.03.13, 18:54.
Leave a comment:
-
Need Help about time difference
Hi,
I can't explain this on the title. sorry for that. What I need is: On my mysql there are several news published in the morning. each comes one after another and sometimes at the same time. I want that it will differentiate with current times with the news time and will highlight the upcoming news.
My mySQL table data's are given below:
Can any one help me on this?PHP Code:while...
echo "<ul style='newsrow'>;
{
echo "<li>".$row['date']." - ".$row['time']." - ".$row['news']."</li>";
}
echo "</ul>";
RegardsTags: None
Leave a comment: