You have typing mistake. You are using the double quotation mark instead of single quotation mark at the end of the code post_status = "publish"
Please use post_status="publish" instead of post_status="publish" and then use double quotation mark at the end of query.
And also make sure that dynamic values are correctly entered in the query by printing the query before execution.
Related Posts:
- How do I make an HTML table from a database table?
- Inserting dynamic content into a page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- Does WordPress cache get_user_meta() results?
- Export User Info to CSV from Front End
- WordPress admin never finishes saving page on site with large page count
- Retrieving and Displaying Data From a Table
- Refresh page after update_post_meta
- Search and Replace in database: How to replace data in SQL dump file on Windows?
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- Why WordPress uses 4 tables to manage terms
- WP database error for comments_popup_link()
- No wp-config.php file on local install of wordpress – site still displays
- How to create Sub Sub domain Multi User blogs?
- How to find the output of contact form 7 shortcode? [closed]
- Issue with foreach on duplicate meta_key’s
- Different database query in function.php using mysqli
- How to generate page content from database the right way?
- Proper way to edit a post via phpMyAdmin without breaking the compare revisions tool
- Store and Work with huge array in WP [closed]
- Adding Custom Forms
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- Is it necessary to sanitize wp_set_password user input?
- database interactions using OOP
- Accessing the database from a plugin outside of action hooks
- Trying to establish connection to External Database
- Create WP_Query to search for posts by their categories or their parent/child categories
- How to save checkbox values for logged in users?
- Update results, Before deleting the related category [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- Split reads to a different connection string
- custom user role wordpress – grant guest access to edit.php without insert/update/delete
- Execute long and heavy processes
- database sent to a JSON file
- inserting a post from an extern php file but post content doesn’t show on wp site
- Databases – Submitting data from inputs to database [closed]
- db converts decimal number wrong
- Filtering a Database Query
- Is it best to avoid using $wpdb for security issues?
- Blob file download problem
- How to retrieve the data from the sever and displaying it in a page?
- wpdb prepare insert table doesn’t work
- Should I use WordPress to skin a database website?
- Creating Database Table vs. Adding MetaData to Post & User
- How can I find the cause of a 500 server error?
- I can’t update my data through $wpdb
- Lost in trying to create user database system
- Delete database record using plugin from admin panel
- How to get image from url from the database?
- Wpdb get->results to out the the month from the db
- Filter results from a serialized string to use on statistics
- How to add data to a custom field at the wp_users table?
- Creating custom page template from existing PHP site
- wordpress site – using custom database and PHP
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Add row to custom database Table and delete all rows older than 1 day
- Using PHP Code Snippets to query a database, $dbconnection->get_results is outputting nothing
- Database entry removed on browser refresh, Ajax PHP jQuery
- Please help! I have a problem with getting wordpress databas
- Change wordpress’ database data using ajax – how to get current user id?
- Error establishing a database connection (Set-up locally)
- add role on WordPress in PHP on a second database
- Limiting posts based on nested meta_query
- Preserving backslashes in post_content
- Error establishing a database connection (configuration)
- Retrieving and Displaying Data From a Table
- Using custom php to connect to database blocks wp from accessing galery pictures
- Can I disable auto increment of WordPress Posts Database to utilize previously deleted records?
- Updating the database after parsing CSV document
- How do I fetch a data from an external database into my wordpress homepage
- Full search and replace isn’t enough to make all pictures to be loaded with https
- How to display post_content from database in different on template page?
- Generate random access token to a post page
- Issue in url update when using wordpress update query
- direct query to post_meta table
- can’t delete a row from post_meta table
- special characters not supporting in wordpress
- How to set max users to 17.000
- How to fetch results from database
- Unserializeing multiple column values that are stored in one database results variable
- Best way to define a database with product codes and back-end support?
- How to connect database table to each registered wordpress user.
- Querying multiple meta_keys in WordPress SQL query
- Trying to post information from a remote database to wordpress page
- Create an unique ID number after submit form
- PHP Call to External Database
- How do I empty a specific meta_value for all users in PHP
- Create custom table for wordpress custom registration flow
- Custom form that stores data in mysql database
- How to get data (not value or name) from radio options to POST to database
- Creating a table via dbDelta
- wpbd to connect to a VPS mysql database
- Retrieve data from external database and insert back in
- How to get the last date updated of postmeta?
- Putting form result in my database
- Issue with WordPress Plugin Activation Hook and Table Creation
- How to improve the performance when using a flat-file dataset and PHP for implementing advanced search function?