shabeer shaik

shabeer shaik

  • NA
  • 40
  • 19.7k

Check date on mysql and allow access

Jan 31 2013 6:39 AM
please help with the following:
datetr= now() + INTERVAL 30 DAY  ( THIS IS DONE WHEN THEY REGISTER )

$result = mysql_query("SELECT `id`,`pwd`,`user_name`,`en1`,`approved`,`user_level`,`datetr` FROM users WHERE
$user_cond
AND `banned` = '0'
") or die (mysql_error());
$num = mysql_num_rows($result);

// Match row found with more than 1 results - the user is authenticated.
if ( $num > 0 ) {

list($id,$pwd,$user_name,$en1,$approved,$user_level,$datetr) = mysql_fetch_row($result);

I need help  here.... if the datetr is greater than now() then it will alow access.
if(!$datetr > now()) {
//$msg = urlencode("Your 30Day Trial has expired. Please make payment of R100 to proceed");
$err[] = "Your 30Day Trial has expired. Please make payment of R100 to proceed";

//header("Location: login.php?msg=$msg");
//exit();
}