when I try to strtotime the result of querying the expiry_date of logged in user, I get this error:krileon wrote: You'll want to retrieve both values, strtotime them, then do your comparison. If you're using $_CB_framework->now() however it's time() so you don't need to strtotime it.
strtotime() expects parameter 1 to be string.
$query = "SELECT expiry_date
from jos_cbsubs_subscriptions
where user_id=$user->id and status='A'";
$result = mysql_query($query);
$exp_date=strtotime($result);
Please Log in to join the conversation.
$query = "SELECT expiry_date
from jos_cbsubs_subscriptions
where user_id=$user->id and status='A'";
$result = mysql_result( mysql_query( $query ) );
$exp_date = strtotime( $result );
$db = JFactory::getDbo();
$query = $db->getQuery( true );
$query->select( 'expiry_date' );
$query->from( '#__cbsubs_subscription' );
$query->where( "user_id = '" . (int) $user->id . "' AND status = 'A'" );
$db->setQuery( $query );
$result = $db->loadResult();
Please Log in to join the conversation.