Jump to content

Only show expired records... now> $contact_next ...


shane85

Recommended Posts

I have a row with a timestamp using strtotime contact_next... 1 day, 2 day, 3 day etc.

once that time is expired, for instance if in that row it shows 2010-04-05 and today is 2010-04-06

 

I want to have a button for viewing expired records. Im using the following query and switch statement to get it to orderby=expired but it isnt displaying expired records, rather just records from the contact_next field that are still good

 

 

// my switch statement

   switch($_GET['orderby'])
{
case "contact_next":
$orderby="contact_next";
break;
case "tstamp":
$orderby="tstamp";
break;
case "company_name":
$orderby="company_name";
break;
case "city";
$orderby="city";
break;
case "expired";
$orderby="contact_next";
break;
default:
$orderby="prospect_id";
break;
}

// then my query
elseif ($orderby==expired)
{
$prospectEntries = mysql_query("SELECT *,UNIX_TIMESTAMP(tstamp) AS tstamp FROM prospects WHERE contact_next < now() ORDER BY ".mysql_real_escape_string($orderby)." ASC ".$queryLimit) or trigger_error(mysql_error());
}

 

whats wrong?

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.