Retrieve a particular value from the options database of an mu user.
-
So I’m a bit of a newb to php and diving in pretty hard core so please forgive what I’m sure may be many mistakes.
I’m have a MU install and custom_options page users fill out. My goal is display indiviual values form that custom options from a number of user on the parent domain. Which means I can’t use get_site_options or get_option as those are relative to the site your on.
My research led me to $wpdb
So the goal will be to perform a query based on a user id or blog id (not sure which yet?), capture the custom_options entries I’m looking for and display them anyway I desire on the homepage.I am good with finding the user id or specifying the blog id form the user id I’m pretty sure I can work that out.
My problem is how to query that options DB.
I have this:
$testing = $wpdb->get_results( “SELECT FROM $wpdb->options WHERE option_name = ‘$allowedthemes'” );
print_r($testing);but this is giving me an output of:
Array ( )rather than showing me the content of the array.
I don’t want the whole array I want just a particular variable which I could work out if the array would ouput.I’ve also tried get_var instead of get-results but when I change get_results to get_var the query breaks.
If I’m in over my head let me know.
- The topic ‘Retrieve a particular value from the options database of an mu user.’ is closed to new replies.