Accessing Addition Fields for user

Discussion in 'Customization & add-ons' started by sitewizard, Nov 29, 2010.

  1. sitewizard

    sitewizard New Member

    Joined:
    Nov 29, 2010
    Messages:
    14
    Hi,

    How can an application outside of amember gain access to user information that is stored in an Additional Field?

    the DATA field in the members table has the data seperated by colons and semi colons in a very strange way.

    I need to extract the data in those fields for any given user from a PHP script running elsewhere on the site.

    Any ideas how this information is split and where that chunk of code is so I can re-use it elsewhere?

    this is what GETS the data that needs to be split (if anyone else is interested!):

    require '../amember/lite.inc.php';
    amember_lite_connect();
    global $_amember_config;
    $prefix = $_amember_config['db']['mysql']['prefix'];
    $q = mysql_query("SELECT data FROM {$prefix}members WHERE member_id = 2");
    print mysql_error();
    list($l) = mysql_fetch_row($q);
    print "$l";

    Any information very much appreciated.

    Best Regards,
    SW
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    use unserialize($l) to convert it to array;

Share This Page