Jump to content

VHS

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

VHS's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ureka!! $query_rsClassified = sprintf("SELECT * FROM classified_ads WHERE enddate_cla >= '$today' AND startdate_cla <= '$today'); This works perfectly only returning the the data that has a start date equal to or less then the current date AND having an end date equal to or greater than the current date. Thanks a bunch for pointing me in the right direction...
  2. This brings back everything in the table regardless of the end date
  3. I am attempting to make a simple classifieds page. I need to create a record set to be used to display info using PHP & MySQL from a table where the current date is greater then the end date in the table and less then the start date. -table structure classified startdate_cla enddate_cla description_cla i.e. Display ALL form table classified where startdate_cla is less then the current date AND enddate_cla is greater than the current date. This should return everything from the table classified where the curent date is equal to or between the start date & end date. Here is my code, can anyone suggest how to make this work. I would appreciate it $today = date("Y-m-d"); $coldate_rsClassified = "-1"; if (isset($today)) { $coldate_rsClassified = (get_magic_quotes_gpc()) ? $today : addslashes($today); } mysql_select_db($database_connCMS, $connCMS); $query_rsClassified = sprintf("SELECT * FROM classified_ads WHERE enddate_cla > %s ORDER BY ID_cla DESC", $coldate_rsClassified); $rsClassified = mysql_query($query_rsClassified, $connCMS) or die(mysql_error()); $row_rsClassified = mysql_fetch_assoc($rsClassified); $totalRows_rsClassified = mysql_num_rows($rsClassified);
×
×
  • 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.