Edit: You have an extra underscore in your table name, it becomes wp__posts
in your case. Better use like how I have shown below 🙂
First, use table names like the following and try var_dump to see if it returns NULL. In case the Post ID doesn’t exist, $product
will be NULL
, which only var_dump can show.
$product = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = 4253");
var_dump( $product );
Related Posts:
- How can I trust switch_to_blog()?
- Sharing Dynamic Sidebars across Multisite Blogs
- latest 5 posts using switch_to_blog loop
- Switch_to_blog() outside wordpress
- why when I try to insert an image attachment along with a post does wp_get_attachment_url give me a very wrong file path?
- Upload images from one site to another in Multisite
- What is the way to share data between sites in a multisite
- get post id by $content (so by post content)
- Register submenu on network menu from the subsite
- Include Site 1 Posts in Query for Sub Sites
- Sort posts according to date
- Multisite switch to blog
- Best Practise: Linking to WPMU sites from other sites
- Display posts from one network site on another
- Get variable from previous blog while using switch_to_blog
- switch_to_blog($blog_id); still writing to main blog
- fatal Error undefined function switch_to_blog()
- How to get all pages on specific blog after switch_to_blog?
- Do “switch_to_blog()” and “restore_current_blog()” re-run the filters?
- Access from template info of another blog (in the same network)
- Get the excerpt by page ID from another blog in a wordpress multisite?
- Convert a Multisite WordPress install into a Single site
- Why are my roles not visible in a Multi-site/Network?
- How to use same email for multiple users
- Multisite: How to store global options vs. site options?
- Mega WordPress Applications WPMU or otherwise
- Does the WordPress API work with multisite?
- wp_get_attachment_image_src multisite issue
- Transfer Subdomain site to Multisite setup
- WP REST API – Multisite – get posts from all sites
- How properly delete only one site (blog) from the Network in WordPress Multisite (WPMU)
- What is the best way to setup wordpress development environment for freelancers with version control?
- Multisite sub-site dashboard redirects to /wp-admin/
- Trying to access second site dashboard on a multisite configuration proceeds to an error
- Get source from the_post_thumbnail
- How to configure WordPress Multisite by bash script?
- WordPress Multisite subdirectories not allowed on new install?
- How to use both British and American English?
- Members area with externally-managed htaccess / htpasswd authentication?
- Using Multisite with a CDN?
- Creating a better multi-site search experience
- BackPress – which libraries i need to load to work with Multisite?
- WP Multisite Static Frontpage
- Architectural reasons behind sitemeta, blogs, home, site and DOMAIN_CURRENT_SITE redundancy
- Login on Multiple Sub-Domains without Multisite
- Redirecting non www to www ONLY for domain, subdomain without www
- WordPress with Lan and Wan Access?
- Moving WordPress Multisite
- WordPress multisite fails to create a new site in the network
- WordPress multisite with subdomain and directory simultaneously
- WordPress Multisite Wildcard Subdomains on Plesk
- WordPress Multisite Question
- Single install or multisite?
- Wrong Redirect/Rewrite Rules?
- Four columns in the wp_users table
- WordPress Folder Multisite – dev, staging, www versions
- Is this the right set of records for Route53 domain to point to a mapped domain in a multisite? [closed]
- Setup a multisite to a running website
- Why is MySQL receiving such a large serialized object?
- How can I remove the folder from a Multisite URL?
- Update post meta using save_post hook in multisite
- Nginx — WordPress multisite with root folder in own directory
- Set up Network Locally on a Flash Drive
- Help with multisite redirect issues using Cherokee OR solid nginx config?
- turning off multi site mode makes XMLRPC fail : you are not allowed to publish posts on this site”
- How to set up wordpress domain mapping on MAMP Pro
- How to show different sub sites based on Member’s user name In word press?
- Debugging unserialize errors [closed]
- Multisite / Network – Stable?
- User Role is Not Specifying in WordPress Multisite?
- Problem in logging in as admin
- 301 Redirection After Comment
- Multisite 404 for pages in includes subdirectory
- Changing Domain Name Broke Database
- Multisite infinite redirect loop
- What is with the one month time limit for sub directory installs for multisite network?
- Can I use the same Folder name as a Multisite Blog?
- How to get the blogs owned by a user?
- WordPress Multisite Dilemma!
- Why WordPress w/ Nginx Multisite Only Lets Admin Upload ZIP Plugins But Not Themes? [closed]
- Installing wordpress on a subfolder of adsense approved domain
- Launch Media Library for specific MU site
- WP-CLI Error Requesting CURL Extension
- Allowing users to manually add or remove themselves to/from WordPress multisite blogs
- multiple domains point to same site on WP-MU
- Can I replace the “Upgrade Network” with SQL query?
- How to convert multisite subdomain from http to https
- One membership area for two websites
- Multisite domain mapping with SSL redirects to main domain
- Define a new sub-folder naming – Multisite
- Multisite install in a subfolder won’t work with www
- Modifying get_author_posts_url() in Multisite
- Domain mapping breaks some plugin scripts and css
- Whats a good strategy for localising WordPress post and page content?
- Get users from all/specific blog by user_role and current_user role
- Updating themes customized by users
- Pages redirect me to the homepage
- Multisite pagination with get_posts
- Best Way to Setup a Network of WP Sites?
- HyperDB, Multisite – on new site creation put site’s tables to specific database