• Hello,

    <?php
    $query = $wpdb->get_var($wpdb->prepare("SELECT meta_value FROM usermeta WHERE meta_key='paypal_user' and user_id=5"));
    echo $query;
    ?>

    Above query returns the following string

    O:11:”Paypal_User”:8:{s:8:”duration”;i:0;s:13:”duration_type”;s:1:”m”;s:6:”amount”;i:0;s:8:”currency”;s:0:””;s:13:”last_pay_date”;s:0:””;s:11:”expire_date”;s:0:””;s:12:”account_type”;s:25:”$5 for 1 Year (Platinum)”;s:10:”status_str”;s:0:””;}

    I want to pull only the s:25 which is “5 for 1 Year(Platinum)”
    How do I do that ?

    thanks,
    Ashwin.

The topic ‘Select query from longtext ( array )’ is closed to new replies.