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 to return number of found rows from SELECT query
- what is the use of /wp-includes/SimplePie?
- Inserting dynamic content into a page
- Check if post of title already exists
- How to export/import theme customizer settings?
- $wpdb->delete column values IN ARRAY()?
- Inserting choice in database table
- WP API V2 returning Invalid User ID
- How To Make Connection To WordPress Data Base In A Plugin?
- Has anyone tried putting PHP ActiveRecord on WordPress?
- How to auto login user again after change user_login
- 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
- Duplicate domain database to local – How?
- error importing localhost export file to server
- How to sort results from a custom database table
- How can I call a row of user specific data from a custom table added to the WP Database
- How to merge local and live databases?
- How to track a users progress through pages by inserting data into WordPress Database?
- WPDB: how to get the value of a field in a custom database table
- Notice: wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- Access/update database with jQuery
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Add custom php database code above
- wp_insert_post not working
- Prevent Data Resubmission On Page refresh
- SQL QUERY – Select a value directly from the database
- Any possible way to make $wpdb->get_results() return anything else than array?
- database interactions using OOP
- Transferring working local PHP site to wordpress – with database (MySQL)
- Accessing the database from a plugin outside of action hooks
- Getting id of poll from WP database
- Storing Array from returned database query and using the array in a new query
- WordPress not reflecting changed of the database
- How does WordPress know wich language is chosen when there is a database connection error
- How can I save unique user data on my site? [closed]
- Dynamic content in template
- Using custom tables for old posts
- Databases – Submitting data from inputs to database [closed]
- db converts decimal number wrong
- Is it best to avoid using $wpdb for security issues?
- How can I import an excel column into wordpress database?
- WordPress Block developer from exporting Database via PHP
- Execute a function every hour in the background
- Create page with custom php script and fetched data
- Should I use WordPress to skin a database website?
- How do I display offsite database info on my wordpress site?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- Cant connect to database with php 7.3
- How to get image from url from the database?
- Set default Database Storage Engine when creating tables with plugins?
- 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
- SQL error with custom query
- Unserialize Custom Field & Save as Multiple Rows in WordPress Database
- 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
- Create a new account on site B with data from the purchase of site A
- How to search order using database frontend short code WordPress
- Limiting posts based on nested meta_query
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- wp_update_post gives 500 internal error
- Unable to insert two value in two different columns (WordPress database)
- Retrieving and Displaying Data From a Table
- why not selecting multiple rows of same standard_id using SQL query from database?
- 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
- getting the values of hidden inputs to use them in a php mysql query
- wp-login.php?redirect_to=https problem
- Front end/Database connection in WP
- Issue in url update when using wordpress update query
- can’t delete a row from post_meta table
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- AJAX Not Working With WordPress Database properly
- How to fetch results from database
- Manipulate database of WordPress site with my own scripts
- How to connect database table to each registered wordpress user.
- Problems with plugin that fetches data from database with ajax
- Let users register weight each day and save it in DB
- Query specific posts per user selections from dropdown menus
- Create an unique ID number after submit form
- Fetching wpdb data from a php file seems to break?
- How to pass username into form that sends data to database
- Insert into db with foreach problem
- 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
- How to get the last date updated of postmeta?
- Putting form result in my database
- Bulk data save in custom table