ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Caching PHP?

January 18, 2011 8:04pm

Subscribe [3]
  • #1 / Jan 18, 2011 8:04pm

    SharonGeorge

    19 posts

    I’m grabbing a purchase date from the database (using simple commerce).  You can see that I display it, along with the member ID with two ECHO statements.  All good.  Then I do some calculations to get a start date for my channel statement later on…for some reason, as I was testing, the date it comes back with is cached for the previous user account I was logged into (so, even though it is displaying the new date as the join/purchase date, the calculated start date is based on the join/purchase date of the previous account I logged in with).  The server has to be caching this, but I can’t understand why.  Is this normal, for PHP to cache something like this?

    The error is happening when I call mktime…it’s using the values from the previous member id that I logged in with before.

    I tried clearing all the cache’s, and nothing worked.

    Sharon

    {exp:query sql="SELECT purchase_date FROM exp_simple_commerce_purchases WHERE member_id = <?php echo $member_id;?>"}
    <?php
    $purchyear = '{purchase_date format="%Y"}';
    $purchmonth = '{purchase_date format="%m"}';
    $purchday = '{purchase_date format="%d"}';
    
    echo '<b>Member ID:</b> '.$member_id.'';
    echo '<b>Join Date:</b> '.'{purchase_date format="%M"}'.' '.'{purchase_date format="%d"}'.', '.'{purchase_date format="%Y"}'.'';
    
    $time = mktime(0, 0, 0, (int)$purchmonth, (int)$purchday, (int)$purchyear);
    $newdate = strtotime ( '+0 years +0 months -1 week +0 days' , $time) ;
    $start_time = date('Y-m-d H:i', $newdate);
    echo 'Start From:'.$start_time.'';
    ?>
    
    {/exp:query}
  • #2 / Jan 19, 2011 10:35am

    Sue Crocker

    26054 posts

    Hi, Sharon. Are you parsing PHP on input or output? How are you grabbing $member_id? Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version

  • #3 / Jan 19, 2011 12:48pm

    SharonGeorge

    19 posts

    Hi Sue, Thanks for replying.  I think I discovered late last night that it wasn’t caching, it was a problem with my date field.  If you could look at my other post about getting and using a date from the database, that would be most helpful to me.

    It’s titled “Trying to subtract date from database” and it’s in the programming and development thread. 

    Best, Sharon

  • #4 / Jan 19, 2011 3:39pm

    Ingmar

    29245 posts

    So we’re good to close this one out?

  • #5 / Jan 19, 2011 3:44pm

    SharonGeorge

    19 posts

    Yes, but I desperately need help wtih my other post.  Should I have put it in technical support as opposed to development and programming??

    Thx!
    Sharon

  • #6 / Jan 20, 2011 3:58am

    Ingmar

    29245 posts

    Very good, closing. Please post again as needed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases