[PHP] Problem with Subscription PHP? [UberCMS]
So I'm working on a VIP Subscription system for UberCMS, where when a user accesses your me page, it'll check to see if the time is greater than the expiration date, and it will delete the row.
Page loads fine and everything, but it won't query the delete. :L Code:
PHP Code:
<?php }} ?>
<?php if($users->GetFriendCount(USER_ID, true) != "0"){ ?>
<li id="feed-friends">
<strong><?php echo $users->GetFriendCount(USER_ID, true); ?></strong> You have
<span>
<?php
$time = time();
$subresult = mysql_query("SELECT ts_exp FROM vip_subs WHERE user_id = '".USER_ID."'");
if ($subresult < $time)
{
$delsub = mysql_query("DELETE * FROM vip_subs WHERE user_id = '".USER_ID."'");
}
else
{
print hello;
}
?>
This also has everything that I see as important in it (Stuff in its general area that might affect it).
:P Ive coded that myself, taken a while. Please, point out the newb stuff I've done :D:
Re: [PHP] Problem with Subscription PHP? [UberCMS]
try..
PHP Code:
$subresult = mysql_query("SELECT ts_exp FROM vip_subs WHERE user_id = '".USER_ID."'");
$result = mysql_fetch_array($subresult);
if ($result["ts_exp"].....
Re: [PHP] Problem with Subscription PHP? [UberCMS]
Quote:
Originally Posted by
leenster
try..
PHP Code:
$subresult = mysql_query("SELECT ts_exp FROM vip_subs WHERE user_id = '".USER_ID."'");
$result = mysql_fetch_array($subresult);
if ($result["ts_exp"].....
Thanks for replying. :) Gonna test.
EDIT:
No result. No error, though. Checked logs too.
[PHP] Problem with Subscription PHP? [UberCMS]
Strange it worked fine when I tested it last night.
Sent from some remote location using Tapatalk...
Re: [PHP] Problem with Subscription PHP? [UberCMS]
Quote:
Originally Posted by
leenster
Strange it worked fine when I tested it last night.
Sent from some remote location using Tapatalk...
Hmm. :S Maybe I'll just simply enforce a VIP check.
So this can stand alone? :P
[PHP] Problem with Subscription PHP? [UberCMS]
Yes but u will have to do something about the USER_ID. Maybe that's why it did not work for you? Just use some echo's the see if the variables return anything.
Sent from some remote location using Tapatalk...
[PHP] Problem with Subscription PHP? [UberCMS]
Don't worry; it all works. I'm changing it to username instead later to avoid IPN complications.
I'm also going to release this as a 'PayPal IPN - Subscriptions System' soon :)
Re: [PHP] Problem with Subscription PHP? [UberCMS]
PHP Code:
$delsub = mysql_query("DELETE FROM vip_subs WHERE user_id = '".USER_ID."'");
Re: [PHP] Problem with Subscription PHP? [UberCMS]
Quote:
Originally Posted by
Masius
PHP Code:
$delsub = mysql_query("DELETE FROM vip_subs WHERE user_id = '".USER_ID."'");
Ah yes, I also deleted the * when i tested, lmao.....