Ok, I’ve spent hours trying to work out the syntax and format and command to use. My need is simple and once I can see how this l ine should look, I should be able to develop it further myself.
I want to take one piece of data from the wp database and put it in an array. Simple!
Nearest I have come up with is:
$mybit = $wpdb->get_results("SELECT meta_value FROM $wpdb->$postmeta WHERE meta_id = ‘46’ ");
The data I need is in a table called wp_postmeta, and is on the same row as meta_id 46. I want the meta_value to be assigned to $mybit.
I must be close!!!
Can this be called from the root directory? Do I need to set up anything else? Globe etc. Can one line of stand alone code do this or do I need an environment?