Jump to content

[SOLVED] Compare Dates


SkyRanger

Recommended Posts

Did a search and got totally confused on some posts so I had to post my own.  Here is the problem I am having:

 

Client 1 $date = 01-01-2008
Client 2 $date = 02-02-2008

Trying to show clients info before todays date
$date = date( 'd-m-Y' );
$futuredate = date("d-m-Y", mktime(0,0,0,date("d"),date("m")+1,date("Y")));

$result = mysql_query( "SELECT * FROM clients where due < '$date'") or die( "Unable to select database");

Trying to show clients info after todays date
$result = mysql_query( "SELECT * FROM clients where due >= '$date'") or die( "Unable to select database");

 

I am having both entries display in both output tables when I only want one in each.

Link to comment
https://forums.phpfreaks.com/topic/86988-solved-compare-dates/
Share on other sites

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.