Jump to content

comparing the today's date with timestamp value


mrjameer

Recommended Posts

<?php
   $today = strtotime('today');
   $sql = "SELECT `id`, `username` FROM `table` WHERE `time` >= $today";
   $res = mysql_query($sql);
   if ($res) {
      while($row = mysql_fetch_assoc($res)) {
         echo $row['username']."<br />\n";
      }
   }
?>

maybe this works:

<?php
   $today = strtotime('today');
   $sql = "SELECT `id`, `username` FROM `table` WHERE `time` >= $today";
   $res = mysql_query($sql);
   if (!($err = mysql_error())) {
      while($row = mysql_fetch_assoc($res)) {
         echo $row['username']."<br />\n";
      }
   }else echo $err;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.