Getting posts ID in WP Query
<p>I need to update custom fields, I have done a query using wordpress and it returns a row, the row seems to be an object and I cannot extract the posts ID from it.</p>

<pre><code>$wpdb-&gt;query('SELECT * FROM wp_posts WHERE post_title = "' . $result['name'] . '" AND 
post_status = "publish"'); 
if ( $wpdb-&gt;num_rows ) { 
  update_field('field_570e529aa4a41', $result['runs'], $post_id); 
  update_field('field_570e52a7a4a42', $result['wins'], $post_id); 
  //echo '&lt;pre&gt;';
  //print_r($wpdb);
  //echo '&lt;/pre&gt;'; echo 'This Horse is already in the database so we 
  //just updated its statistics'; 
} else {

}
</code></pre>