MySql code for price_group

Discussion in 'Customization & add-ons' started by thomas, Apr 27, 2009.

  1. thomas

    thomas New Member

    Joined:
    Aug 29, 2006
    Messages:
    23
    I see that the Price Group for a product is in the "Data" field of the product record. But the data field appears to have a significant amount of additional fields in it, and apparently delimited in some form or fashion.

    For example, the "data" field holds the following information (PriceGroup info is in red):

    a:13:{s:11:"expire_days";s:2:"30";s:3:"url";s:46:"http://www.******.com/index.php";s:8:"add_urls";s:0:"";s:5:"scope";s:6:"signup";s:5:"order";s:3:"207";s:11:"price_group";s:4:"-102";s:13:"renewal_group";s:0:"";s:14:"need_agreement";s:0:"";s:13:"autoresponder";s:0:"";s:19:"autoresponder_renew";s:0:"";s:16:"dont_mail_expire";s:0:"";s:13:"require_other";a:1:{i:0;s:10:"ACTIVE-108";}s:16:"prevent_if_other";N;}



    I have basic MySQL knowledge, but have never seen data in a field like this. Can someone help with what the MySQL code/statement to search for the price_group field?
  2. codeispoetry

    codeispoetry aMember Pro Customer

    Joined:
    Jan 12, 2009
    Messages:
    336
    Hi thomas,

    What do you need to do?

    The Price group is available under aMember CP > Manage Products. The full list of products with their price_group should be there.

    Lee
  3. richie

    richie New Member

    Joined:
    Aug 22, 2006
    Messages:
    12
    How to unserialize

    Hi Thomas

    If a member is logged in, the product_id is stored in a session array. But if you need to query the data from the database yourself you need to use the PHP unserialize command to break apart the string, like so:

    $newarray=unserialize($result['data']);

    If you wanted to store data in that manner, you can convert it back using the serialize command in the same manner.

    Hope this helps!

Share This Page