Need Help about time difference

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Vayne
    replied
    WHERE date='$data'
    AND date>date();
    ORDER BY time DESC
    LIMIT 1; ?
    Last edited by Vayne; 19.03.13, 22:24.

    Leave a comment:


  • asifnayem
    replied
    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:


  • Mysterio
    replied
    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:


  • asifnayem
    replied
    Can anyone help me out on this??

    Leave a comment:


  • asifnayem
    replied
    Originally posted by pichiriche View Post
    Sql code ? Post here
    PHP 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:


  • pichiriche
    replied
    Sql code ? Post here

    Leave a comment:


  • asifnayem
    started a topic Need Help about time difference

    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:

    PHP Code:
    while...
    echo 
    "<ul style='newsrow'>;
    {
    echo "
    <li>".$row['date']." ".$row['time']." ".$row['news']."</li>";
    }
    echo "
    </ul>"; 
    Can any one help me on this?

    Regards
Working...
X