shane85 Posted April 6, 2010 Share Posted April 6, 2010 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? Quote Link to comment Share on other sites More sharing options...
leehanken Posted April 6, 2010 Share Posted April 6, 2010 if contact_next is a unix timestamp integer, I think now() might also be interpreted as a number in the YYYYMMDDHHMMSS.uuuuuu format how about saying UNIX_TIMESTAMP() instead of now() ? Quote Link to comment Share on other sites More sharing options...
shane85 Posted April 7, 2010 Author Share Posted April 7, 2010 tried using that and it still displays all the records Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.