$value) { $$key = stripslashes($value); }
}
// Get expirey date
// Construct a join query which already ADDS ONE YEAR to the date of purchase to result in expirey date
$query22 = "SELECT sales.id, sales_items.sale_id, sales_items.item_id, DATE_ADD(sales.date, INTERVAL 1 YEAR) as expires ".
"FROM sales, sales_items ".
"WHERE sales.id = sales_items.sale_id AND sales_items.item_id = '1' AND sales.customer_id = '$_GET[userID]'";
$result22 = mysql_query($query22) or die(mysql_error());
$today = date('Y-m-d');
// Print out the contents of each row into a table
$row = mysql_fetch_array($result22);
$expires = $row['expires'];
// echo "EXPIRES $expires";
if ($row['item_id'] == "1" && $expires > $today){
$expiredate = $expires;
} else {
$expiredate = "Not Paid (or expired $expires) (USE SALES to sell a membership)";
}
//mysql_free_result($result);
?>