getting values from the data field of amember_members table

Discussion in 'Customization & add-ons' started by todddown, Dec 28, 2009.

  1. todddown

    todddown Member

    Joined:
    Nov 24, 2009
    Messages:
    37
    Hi!

    here is the contents of the data field in one of my records;

    a:5:{s:9:"is_locked";s:0:"";s:7:"company";s:0:"";s:14:"time_remaining";i:720;s:6:"status";a:3:{i:65;i:1;i:66;i:0;i:1;i:1;}s:9:"is_active";i:1;}

    Does anyone know how I can get the time_remaining and its value of 720 out so that I can show it on a custom admin page?
  2. aser

    aser Moderator

    Joined:
    Apr 25, 2007
    Messages:
    13
    <?php
    $data = 'a:5:{s:9:"is_locked";s:0:"";s:7:"company";s:0:"";s :14:"time_remaining";i:720;s:6:"status";a:3:{i:65; i:1;i:66;i:0;i:1;i:1;}s:9:"is_active";i:1;}';

    $data = unserialize($data);
    echo $data['time_remaining'];
    ?>
  3. todddown

    todddown Member

    Joined:
    Nov 24, 2009
    Messages:
    37
    Perfect! Thanks very much :)

Share This Page