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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.