$wpdb->get_results()
only returns arrays( associative or numeric) or an object. It does not return a string value.
If you want a string value, you need to use $wpdb->get_var()
instead
Related Posts:
- How to return number of found rows from SELECT query
- The correct method to pass query vars in AJAX using ajaxurl
- $wpdb->delete column values IN ARRAY()?
- wpdb::prepare was called incorrectly
- How to sort results from a custom database table
- WPDB: how to get the value of a field in a custom database table
- Can’t use get_results() in ajax query
- WP database error for comments_popup_link()
- Access/update database with jQuery
- Ajax $wpdb not returning table data
- How to Fetch values from WP database based on selected option value by onchange using PHP?
- Why is variable not working on custom sql query using wpdb?
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- Get stock by custom meta field on all Woocommerce variable products
- database interactions using OOP
- Accessing the database from a plugin outside of action hooks
- Echo a hierarchical list of post data from custom fields
- Trying to establish connection to External Database
- Create WP_Query to search for posts by their categories or their parent/child categories
- Getting id of poll from WP database
- Storing Array from returned database query and using the array in a new query
- How to insert a single row to WP database table?
- $wpdb->update with multiple parameters gives error
- Update results, Before deleting the related category [closed]
- How WordPress reacts to a lack of memory of the server [closed]
- wpdb php get_var query to get ID for URL image doesn’t work for ID over 999
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- unable to use ‘new WP_Query’ in AJAX call
- How to retrieve the data from the sever and displaying it in a page?
- Can’t update multiple rows with $wpdb query
- Can I make get_users() query global?
- I can’t update my data through $wpdb
- wpdb Cannot Update column in Database
- Shortcode to pull posts
- PHP -> SQL Query with Summing
- Delete database record using plugin from admin panel
- Cannot access $wpdb, comes back NULL
- Wpdb get->results to out the the month from the db
- How to use AJAX in WordPress in MYSQL query?
- WPDB – Read and write value from / to database
- Why my query does not run with prepare
- How to Generate a list of Most Commented post?
- Undefined variable: row?
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- SQL error with custom query
- WordPress Conditional / Multiple Taxonomy Query
- Add posts to custom table in database instead of wp_posts
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- Database entry removed on browser refresh, Ajax PHP jQuery
- My Custom Post Type AJAX Query is Returning no posts – why?
- Using wpdb to connect to a different database is not working
- getting the values of hidden inputs to use them in a php mysql query
- Offset with ajax load more posts duplicates
- How to grab data from input and store it into custom table in database?
- How to query a staging database?
- MySQL query in WordPress with AJAX
- Accessing external database: ERR_INCOMPLETE_CHUNKED_ENCODING
- Run insert if no entry otherwise run update with ajax
- How to fetch results from database
- Unserializeing multiple column values that are stored in one database results variable
- Problems with plugin that fetches data from database with ajax
- Check if values exists DB
- AJAX with Selectbox Plugins (Select2, Chosen, Selectize)
- Querying multiple meta_keys in WordPress SQL query
- MySQL database migration to WordPress
- Fetching wpdb data from a php file seems to break?
- Insert into db with foreach problem
- notify users when changed database
- How to display inputted data in Ajax without button or click event
- WordPress Query -> Ajax Query
- how to display tables via ajax
- How to get data (not value or name) from radio options to POST to database
- Putting form result in my database
- How to export/import theme customizer settings?
- Looking for a better way to handle an ajax script that pulls in post data on click
- Passing jQuery value using Ajax to a page template
- Why is this Ajax not working?
- Add custom php database code above
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- Databases – Submitting data from inputs to database [closed]
- Problem with AJAX in wordpress plugin
- How to keep track of when a vote is cast?
- set post limit at load more ajax wordpress
- AJAX wp_insert_user WORKS but responds with “The site is not enabled”
- Ajax filter button display all posts
- Incrementing PHP variable onclick to display posts by month
- WordPress PHP syntax doesn’t seem to be working correctly
- MySQL Query Returns Array () In Shortcode
- Change wordpress’ database data using ajax – how to get current user id?
- array wordpress when get is null
- PHP calling AJAX function that relies on passed PHP function values not working
- How to use wp_ajax_set_post_thumbnail?
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Updating the database after parsing CSV document
- problem in using wpdb->prepare and a string placeholder
- Advanced WordPress SQL Query
- Is custom behaviour possible when asynchronously uploading?
- WP_Query not returning results