Title: Integration issue &#8211; can&#8217;t read table value
Last modified: August 19, 2016

---

# Integration issue – can’t read table value

 *  [bakhlawa](https://wordpress.org/support/users/bakhlawa/)
 * (@bakhlawa)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/integration-issue-cant-read-table-value/)
 * Related to my earlier post about getting recent posts into the frontpage while
   WP is installed in a subfolder, I am trying to get a custom field accessed through
   the code (an image filename) to no avail. Can someone tell me what is wrong with
   this?
 * $news=$wpdb->get_results(“SELECT ‘ID’,’post_title’,’post_content’ FROM $wpdb-
   >posts WHERE ‘post_type’=\”post\” AND ‘post_status’=\”publish\” ORDER BY post_date
   DESC LIMIT 3″);
 * foreach($news as $np){
    $image=$wpdb->get_results(“SELECT ‘meta_value’ FROM $
   wpdb->postmeta WHERE ‘post_id’=$np->ID AND meta_key=\”featured_home_img\””);
 *  echo “Image is [$image->meta_value]”;
    }
 * $image->meta_value always comes back with an empty result. I checked the SQL 
   query in phpMyAdmin and it executed just fine (with the value for “featured_home_img”
   returned). I checked the postmeta table and the relevant posts all have a meta_key
   called “featured_home_img”, so no problem there.
 * Please help me solve this. I am going bonkers again.

Viewing 1 replies (of 1 total)

 *  Thread Starter [bakhlawa](https://wordpress.org/support/users/bakhlawa/)
 * (@bakhlawa)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/integration-issue-cant-read-table-value/#post-838434)
 * <bump>
 * Still need help with this one. I just need to know how to get to custom field
   values for a post on the homepage (root folder of domain) when the WP blog sits
   in a subfolder.

Viewing 1 replies (of 1 total)

The topic ‘Integration issue – can’t read table value’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [bakhlawa](https://wordpress.org/support/users/bakhlawa/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/integration-issue-cant-read-table-value/#post-838434)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
