This is a cronjob to check where a users subscription has expired. There are 4 different types of subscription.
However I'm completely lost as to why it doesn't update the database when I run the command.
Below is the script:
$sub = mysql_query("SELECT turboexpires,platinumexpires,goldexpires,silverexpires FROM $tab[user] WHERE id='$id'");
$expire = mysql_fetch_array($sub);
echo "".$expire['0']."";
echo "".$time."";
if($expire[0] <= $time){ mysql_query("UPDATE $tab[user] SET turbo='no' AND turboexpires='0' WHERE id='$id'"); }
if($expire[1] <= '$time'){ mysql_query("UPDATE $tab[user] SET platinum='no', platinumexpires='0' WHERE id='$id'"); }
if($expire[2] <= '$time'){ mysql_query("UPDATE $tab[user] SET gold='no', goldexpires='0' WHERE id='$id'"); }
if($expire[3] <= '$time'){ mysql_query("UPDATE $tab[user] SET silver='no', silverexpires='0' WHERE id='$id'"); }
I put the echo's in to check that they were working and they are.
$expire[0] comes back with a unix timestamp, in this case a past one. $time comes back with the current unix timestamp.
I also tried removing the '' around $time as shown above with no luck.
However, when I then proceed with the command nothing happens in the database.
Hopefully an easy problem, I've just been looking at it for so long I'm completely lost!
Thanks for any help!
P.S yes I know I need to upgrade to mysqli, it's on the todo list haha!