$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:
- Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder
- 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
- WordPress Insert line in DB when clicking a button
- Creating a Multi-Level Associative Object Using AJAX
- WP Query with custom Shortcode
- WSoD being caused by this piece of code
- wordpress count link clicks by ip address
- Advanced SELECT query with condtional statements
- Ajax – Call to undefined function get_option()
- Select two sums with single get_var statement
- I want to select the from values from database in WordPress? [closed]
- WordPress not reflecting changed of the database
- ajax, right way to do it and make it works?
- mysql query from wordpress page using custom table
- WordPress 3.2 query_posts and pagination, permalinks issue
- only show container with next/prev links if they exist?
- mysql query two database tables, users and usermeta and sort by custom meta int value
- Ajax load more posts with multiple tax query
- Ajax call not working
- What query string parameter is available for index.php, that works for both pages and blog articles?
- ACF: how do I get the fields and its values of a specific group?
- How to save checkbox values for logged in users?
- How to store data from multiple forms using ajax and php
- WordPress Sending data to Ajax with select option
- PHP 8, AJAX mail form to function.php doesn’t work
- wp search-replace on database returns PHP fatal error: Array and string offset access syntax with curly braces is no longer supported