Can someone help me with a simple fix about my code of an simple function? thanks before!! Im getting that error into my logs: PHP Notice: Undefined index: ID
function hasMembership($odb) {
$SQL = $odb -> prepare("SELECT `expire` FROM `users` WHERE `ID` = :id");
$SQL -> execute(array(':id' => $_SESSION['ID']));
$expire = $SQL -> fetchColumn(0);
if (time() < $expire)
{
return true;
}
else
{
$SQLupdate = $odb -> prepare("UPDATE `users` SET `membership` = 0 WHERE `ID` = :id");
$SQLupdate -> execute(array(':id' => $_SESSION['ID']));
return false;
}
}