You can get a post row by the ID
global $wpdb;
$mylink = $wpdb->get_row( "SELECT * FROM $wpdb->posts WHERE ID = 10" );
Related Posts:
- How to display SQL query that ran in query?
- How to Use Wildcards in $wpdb Queries Using $wpdb->get_results & $wpdb->prepare?
- wpdb get posts by taxonomy SQL
- Multipart/formatted MySQL query problem
- WordPress creating excessive joins on meta_query with search
- cron job to auto delete posts of a specific post type older than x days
- Are database queries created using WordPress filters protected from SQL injection?
- Get posts by category with pure SQL query
- Custom query to get terms from post ids
- Get the timout value of a saved transient?
- What’s wrong with my $wpdb prepare?
- How do I see the mysql query generated by get_posts( $args )?
- problem with sql query in wordpress plugin
- Attempt to improve WP search, can someone check my SQL query?
- wpdb query problem to access previous 3 days posts
- I can’t figure out what’s wrong with this statement. $wpdb->query update
- Custom Query – Based on user input
- how to insert missing tags into the posts through mySQL?
- $wpdb->prepare affecting the query?
- WordPress SQL search, how to handle SQL Injection?
- exclude pingbacks from wordpress SQL query
- prepare function sql safe method
- WordPress SQL query to tag all posts containing a specific word on title
- Select column name dynamically mySQL Query
- How do I query for posts by custom meta and those that have been stickied?
- Change pure SQL database query to WordPress post query?
- Cannot get sql request from Query object?
- I want to get on those users their meta value are like “AGENT” .. but this query is not working
- Display data from phpMyAdmin with WordPress
- SQL to Query the db and return all posts and it’s metas
- SQL query to delete users with multiple meta keys and comments
- Nested select statements not working
- Speed up search query that searches in post meta?
- Are there any best practices for creating a Like/Favourite feature in WordPress using custom MySQL tables and without any plugins?
- Fastest and most efficient SQL query to check if UID exists
- How to make MySQL search queries with quotes
- How i make a custom sql query for Woocommerce
- $wpdb query for price in custom field value
- Run an update query in a function
- How to display a specific category using a custom Query in WordPress?
- Slow query when joining wp_posts with a lookup-table?
- Wpdb generates too many queries
- learn to run wpdb class
- SQL Query : how copy all tags of post into their post content in wordpress by sql query
- Where can I find the SQL to get the most used information by wordpress database?
- Custom Query for wp_posts using wp_postmeta
- 3 queries to update WordPress
- What SQL Query to do a simple find and replace
- How to Optimize WP site for millions of posts
- How many WordPress SQL Queries per page?
- Advanced Custom Fields – Query Efficiency
- How to display lastest post date in the homepage?
- How to tell if $query_var isset?
- Sorting Grids with Essential Grid and Events Manger
- my function doesn’t return my post from today
- Does meta_query work within get_posts array?
- Slow meta_query with about 4 milion record on wp_postmeta
- How to show more than 5 posts?
- WP Query Sort by meta value (date)
- mySQL query. ORDER BY meta_key
- Strange string in console from wpdb query
- Update slug (URL) of pending posts via phpMyAdmin
- Query metas (and not : query posts by metas)
- Select query for a login
- Get stock by custom meta field on all Woocommerce variable products
- Exclude featured image and custom field from this get_attachment query
- Select Query demand excesive resources [closed]
- Query to get number of posts last week
- Include data from custom table in WP_Query
- Exclude categories from the_category();
- How can i show all categories using wp query?
- All in One Calendar Plugin Custom Post Type Query [closed]
- Get Posts from Last 24 hours and Sort them via GD Star Rating
- Query returning same results even though the ID changes
- Is it possible to query from external database? [duplicate]
- How to read the value of a WordPress $query associative array (hash) key
- PHP -> SQL Query with Summing
- Query posts based on previous query
- Waypoints + infinite scroll with custom query
- Customizing the_tags output?
- Re-sort get_posts query results
- How do I get all results from my query
- Taxonomy filter under Polylang
- How to create an overview of posts with the same tag?
- Pagination not working on custom post types with rewrite slug
- JetEngine Query Builder – order by value from repeater
- Filter orders by modify date
- How to add url parameter to every search query in SearchWp?
- Heavy meta query causing SQL crash
- very slow wordpress query with default query
- Custom Query problem access the values
- If more than 1 image show post link?
- How to specify what kind of is_single post?
- Can’t See Media Queries with Inspect Tool [closed]
- Print data from wordpress sql query
- Can I create my own query in wordpress with traditional methods?
- How do I troubleshoot Maximum execution time of 60 seconds exceeded in updating a Media File?
- update $wpdb one query
- Admin Post List table Query filtering “WHERE” for custom post type
- How to use a dynamic term id for the query block