blirette
Member
Posted 2 years ago #
Hey,
I'd like to know how to access the object received from a query? I usually get an array, not an object from a query so I normally do this :
$arrayValue['nameOfTheKindOfValue']
How to do this with an object?
Thanks, I'm sure it's pretty easy for you to answer.
blirette
Member
Posted 2 years ago #
$value = $post -> nameOfTheKindOfValue;
blirette
Member
Posted 2 years ago #
Or you could just use an array instead :
$pageposts = $wpdb->get_results($strQuery, ARRAY_A);
... and be able to use it as an associative array instead of an object ...
$pageposts = $wpdb->get_results($strQuery, OBJECT);
More infos here : http://codex.wordpress.org/Function_Reference/wpdb_Class