Please help me with $wpdb custom query to display author meta_value
-
I am no programmer – I’ve figured out this bit of code to find all the instances of meta_value = myvalue and print the user_id for each, but I really need help with the next step:
<?php $industrycat = $wpdb->get_results("SELECT user_id FROM $wpdb->usermeta WHERE meta_value='Web/Interactive'"); foreach ($industrycat as $industrycat) { echo $industrycat->user_id; } ?>
What I want to do, instead of printing the user_id, is print all the meta_values for a certain meta_key out of the selected group.
For instance, when all the rows that have meta_value=’Web/Interactive’ are selected, I want to display the meta_values associated with meta_key=’company’ – the company names for each ‘Web/Interactive’ row.
Does this make sense? Please help, I have no idea what I’m doing and I’ve been reading pages and articles about $wpdb for 2 days.
- The topic ‘Please help me with $wpdb custom query to display author meta_value’ is closed to new replies.