$mpcountrys is going to be an array or an object. In your case, an object, which is the default.
One of four pre-defined constants. Defaults to OBJECT. See SELECT a
Row and its examples for more information.https://codex.wordpress.org/Class_Reference/wpdb#SELECT_Generic_Results
It looks to me like you probably want get_var() instead.
And I would highly recommend a bit of sanitaziation/validation of your user supplied values before trying to use them.
Related Posts:
- How can I fetch loop of post titles via AJAX?
- Adding “Remember Me” in custom login
- The correct method to pass query vars in AJAX using ajaxurl
- Using wp_send_json to return HTML
- Is having multiple theme customizers for different pages possible?
- WordPress Ajax always returns a 404 error
- Redirect to Page after Post Submit
- problem with ajax and the path to the php page
- simple wordpress ajax plugin not working when not logged in
- AJAX / Read More: multiple check_ajax_referer() and wp_create_nonce() not working independentely
- Audio Player not loading when the content is loaded through Ajax, MediaElement.js no applied
- Targeting single page with JS
- Handling an Ajax form submit
- Ajax call to my WordPress website from an external application [duplicate]
- Constructing a custom login form using ajax
- Custom WordPress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB
- Click loads template via ajax
- How to retrieve the content (with a specific ID) via ajax by clicking a link tag
- WooCommerce: update custom fields after checkout validation failure
- How to speed up admin-ajax.php in wordpress
- Put CSS inside a PHP file and include it the right way
- Sending jsPDF documents to the server
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- Why is the post meta[] empty when I make a call to the wordpress rest api?
- Checking for new message using AJAX and PHP. Server overload?
- Ajax not working es expected (Returns 0)
- Load a page into a div with Ajax
- Ajax category filtering products default show all
- Status 400 for AJAX POST Request with admin-ajax.php
- Why ajax doesn’t work on certain wordpress hooks?
- AJAX pagination, update current page
- adjust section according to country?
- Change “add to cart” button color based on Woocommerce product category [closed]
- Ajax request returns ‘Array’. How to output the actual results?
- Ajax call return 404
- Fancybox type popup window that’s not an iframe
- how to update and display an option without reloading the page
- Pull GetOption() variable into jQuery dynamically created html
- Load Posts on Click via Ajax into a DIV
- WordPress REST API register_rest_route give a 500 error
- admin-ajax GET response bad request
- Ajax search shows all results when user empties input?
- Why i can’t get custom fields value or post ID via Ajax?
- Post not populating for custom post type based on category selection
- Get uploaded image and attach it to the new post
- Cannot access $wpdb, comes back NULL
- Admin-ajax php not working on new wordpress version
- Proper way to use WordPress function with AJAX PHP file
- Convert canvas to image and upload image to server
- Live search from database table
- Add a counter for mouseovers (custom field)
- Accessing an API with jQuery and AJAX
- PHP: How to access db the right way in plugin?
- How to split AJAX response into two divs
- How to set variables with AJAX request to use in another function in WordPress
- How to use wp_send_json() and output the value with ajax?
- Store ajax data in PHP variable
- Ajax result show in console if is called outside function and not showing in array
- How to change PHP variables with AJAX request in WordPress
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- How can I get my WordPress plugin to receive data and relay it in an ajax/php request to a remote server that requires authentication?
- 400 bad request admin-ajax file upload
- wp_ajax_ 400 Bad Request
- update_post_meta Not Processing Array Data (Not Sure What I Am Missing)
- WordPress AJAX PHP(html) file that is within WordPress Loop
- Why the responseText containing those two arrow signs at the beginning
- Cannot transfer ajax post data from js to php file
- WordPress Ajax filter: Create two loops for different output styles?
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- wordpress dependent dropdownlist using post type is not working
- Input field duplicates on form submit by jQuery
- Following/Followers Users list Using Ajax Pagination inside Author Profile
- How to echo a PHP code into WooCommerce variation product?
- How to call a function from functions.php with ajax?
- Ajax in a class instantiated via shortcode
- Custom Post type Ajax search results
- Ajax wordpress function showing source code in alert and not value of input field?
- Problem with ajax request and directory structure after site migration
- Code works on page-example.php by not category-example.php
- Retrieve $_POST data to send to javascript without using localize script
- ajax form with multiple submit buttons and values
- How to run ajax in WordPress Post?
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Add php function into .js file (for tinyMCE button)
- WordPress will suddenly stop saving files uploaded by my code (ran in nopriv ajax)
- WP_Query based on another query on the page
- ajax form function error
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- send meta box input data without publish button
- wp_enqueue_scripts with JS script as a string
- How to use url and amin-ajax.php
- WP – Ajax call back data printed in the console.log
- How to Set Page Pagination Using Ajax JQuery – WordPress
- How to pass and validate nonce in custom REST routes
- ajax problems on loading page [closed]
- AJAX WP_Query’s order and orderby parameters not working
- How can I use AJAX in child theme template?
- Help with AJAX request
- custom AJAX filtering logic and outputting results into an Elementor Loop Grid widget
- Trying to GET data with ajax from database and show in fullcalendar