0

OK, basically I want to check the DB against the elearningid... if the elearningid startdate and enddate are valid, continue, else redirect to expired.php...

EXAMPLE:

<?php
function TimeBomb() 
{ 
      rs = sql.Execute(" SELECT * FROM elearning WHERE elearningid=@elearningid AND GetDate() BETWEEN startdate AND enddate ");
      if (rs.RowCount > 0)
      {
           return true;
      }
      else
      {
           return false;
      }
 }
 if (! TimeBomb())
      {
           header("Location: expired.php");
      }
}

?>

Anyone have any ideas what I'm missing...

Thanks,
Ted

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by mschroeder
0

I realized I wasn't using the Date function coorectly... But it still doesn't work...

<?php
function TimeBomb()
{ 
      rs = sql.Execute(" SELECT * FROM elearning WHERE elearningid=@elearningid AND DATE_SUB(enddate - startdate) ");
      if (rs.RowCount > 0)
      {
           return true;
      }else{
           header("Location: expired.php");
           exit;
      }
}
?>
0

This almost looks like you're trying to work with a java or javascript object instead of php.

In PHP it would be something like:

$rs = $sql->Execute('SELECT ... ');
if( $rs->rowCount > 0 )
{
     return true;
}
else
{
    header('Location: expired.php');
    exit;
}

Are you getting any errors if you add error_reporting( E_ALL ); to the top of your php code?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.