www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Comparing Time

Threaded View

  1. #1
    Join Date
    May 2009
    Posts
    235

    resolved [RESOLVED] Comparing Time

    I am trying to make a list that will only show events that have happened. The event is put in by month day and year. Here is my code:

    PHP Code:
    $todaysdate strtotime('now');
    $sql "SELECT * FROM cle";
    $result=mysql_query($sql) or die("Couldn't execute query: ".mysql_error());
    while (
    $rows=mysql_fetch_array($result)) {
    $month $rows['month'];
    $day $rows['day'];
    $year $rows['year'];
    $cutoffdate strtotime($month/$day/$year);

    if(
    $cutoffdate <= $todaysdate){
    echo 
    '<tr><td>'.$topic.'</td></tr>';
    } else {
    echo 
    "";

    Last edited by beylah; 01-20-2014 at 08:49 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles