One of the fields in my datatbase is called County. Another is called ExpDate.
I am using SELECT DISTINCT to list the number of different counties listed in the database, but ONLY if the membership has not expired.
$now is the current timestamp. Can anyone see anything wrong with this?
$query = "SELECT DISTINCT County FROM table_name WHERE '$now < ExpDate' ORDER BY County ASC ";
$result = mysql_query($query, $link);
while( $row = mysql_fetch_array($result) ) {
echo("<BR>$row[County]");
}
The result appears to include counties, even when the expiry date has been passed.