You have a typo
$a = the_ID();
$data = $wpdb->get_results("SELECT `id`,`guid` FROM `wp_posts` WHERE `post_type` = 'local-offer' group by `post_author`");
$result = $wpdb->get_results("SELECT * FROM `wp_postmeta` WHERE `post_id` = ".$a." ");
Related Posts:
- Alter query on edit.php
- Automatically generate Post/Page from searched Database item?
- Build A Custom SQL Query for WordPress Search
- How to update custom fields using the wp_insert_post() function?
- Disable Attachment Pages Completely
- Transaction when using WP functions rather than vanilla SQL?
- $wpdb->get_results(…) returns empty array despite correct query
- Inject post (from specific category) between posts in Loop
- Remove option to allow trackbacks/pingbacks from post page options
- How to get the list of WooCommerce product image of a certain category from database?
- Display posts by month
- How to make WordPress plugin check for database changes and then do something?
- Custom SQL query to get List of posts with featured image url
- Permanently remove first image from posts
- How to get year, month and hour in WordPress?
- How to auto login user again after change user_login
- How to display multiple Post meta_key/meta_values by SQL query
- Handling error states with admin_post
- How to Join two tables from separate databases within WordPress
- count number of user comments with a specific comment meta value
- get_the_content if it contains multiple lines it results in SyntaxError
- Looking to exclude blog posts from category Previous/Next buttons
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- Insert code when users come from an specific referer
- Handling an Ajax form submit
- Automatic Excerpt Not Working
- How to display related posts from parent category
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- WPDB: how to get the value of a field in a custom database table
- Using a javascript file to access a get posts array
- Database “Migration” for Plugins?
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- my function doesn’t return my post from today
- New Plugin Review
- Make custom field meta not display if there is not data in it
- Print number of post (in reverse)
- Use template for posts with a particular category grandparent
- Count number of published posts by type
- Enhanced WordPress Search
- WP Insert Post function – Insert Post Thumbnail
- List of posts by day of the week
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- How is WordPress manipulating the posts like there are folders?
- Get_the_author doesn’t return author name
- Styling images coming from another blog
- register_activation_hook isn’t adding table to DB
- How to display posts of specific category using a custom Query in WordPress?
- What SQL / WordPress queries would need a nonce?
- Renaming post IDs – Okay to do?
- Get taxonomy terms only of the WP_Query current posts
- How to generate page content from database the right way?
- Exclude posts from homepage having a specified tag
- How to get 2 or multiple custom post types in wordpress functions.php
- “before delete post” action fire when the post is updated?
- Displaying a button on each post
- Trying to make php run in a post
- Hide post if matches current month and year
- Creating bulk posts with Youtube videos
- phpMyAdmin displays error when importing database
- Remove posts after a given amount of time
- Preferred Method of debugging a wordpress SQL calls?
- Automatically add custom CSS to new posts using a category template
- How Display Posts on category
- Hide wordpress field if data is empty in post!
- How can I use wp_query to show all product data using just the products ID?
- Query all posts of a custom taxonomy term
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Retrieving Author ID in wp-admin area
- Get stock by custom meta field on all Woocommerce variable products
- Getting a specific post values to another div or modal
- Trying to add attribute to my posts’ featured image
- Transferring working local PHP site to wordpress – with database (MySQL)
- how to delete 30 day old data using PHP [closed]
- Display fields as values in array from external SQL DB
- Displaying the last post on static homepage
- Can’t get wp_insert_post to work
- Why not yield/iterable in posts interface?
- Best practice for migration friendly images in posts/pages?
- Posts sortable column not sorting properly for custom field numbers
- WordPress article with 50 000 words loading slow – 100% cpu
- link to page_for_posts
- Display post of specific category on page
- HOW TO Insert Existing PHP Code to WOrdPress
- Query posts by custom fields (object post)
- How to modify this function to exclude also the post belonging to a specific category?
- How to customize posts in WordPress by using HTML and CSS?
- How to display the date under the post title?
- foreach all the post
- How to list all the posts in a personalized page? WordPress
- Excerpt all post content Content Same Size without word cutting off
- How to create a loop that will display one post and stop?
- $post->ID calls for current page, but what is the code to call for any new page created and published in WordPress?
- Blog Posts not sorted and pagination not adjusted after filtering some category
- Set post to draft if matching word is found in the post
- Disable single posts, but keep archive
- Add multiple HTML attributes to an Elementor button
- WooCommerce: write featured image dimensions to custom fields in product’
- Search results always returns “No results” no matter what
- How to create a WordPress PAGE in another folder?
- Can’t send form data to wpdb when URL has query string