How to compare your dates in database mysql?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rolyestemonio
    New Member
    • Oct 2010
    • 1

    How to compare your dates in database mysql?

    I have a problems of comparing dates in mysql.Can anyone help me out?
    the codes goes like this:
    Code:
    function getlocal()
                          {
    $sql = mysql_query("SELECT * FROM tbl_localnews");
    $result = $sql;
    return $result;
                          }
    
     <?php
    							$result = getlocal();
    							$new = $result[0]['dates'];
    while($row = mysql_fetch_array($result)){
    $news = $row['dates'];
    if ($row['dates'] isEqual ){
    
    ...display by dates
    
    }else{
    ..they will diplay another date.
    							?>

    Your help is highly appreaciated guys..thanks
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    A number of points.
    This is PHP not MySql.
    You haven't defined the problem.
    What dates are you trying to compare?

    Comment

    Working...