I have an array of data coming from table. It has number of fields and post_id(int)
is one them. I want to get unique value of post_id
field of returned array.
$data
is returned query
foreach ($data as $key => $get_values) {
$post_id = $get_values->post_id;
$get_query = "select DISTINCT (post_id) from wp_postmeta where post_id = $post_id";
$get_postId = mysqli_query($get_query);<br>
}
I want to get DISTINCT (post_id) only.
Any one have solution or any Idea?