If you really just want a single row, use $wpdb->get_row($sql)
instead.
But your query looks funny…it looks like you’re trying to get the latest ‘client status’ for the user in which case your query should be:
'SELECT status FROM Clients WHERE UserID = '.$current_user->ID.' ORDER BY ID DESC LIMIT 1'
.
And if you do that, you can then even use $status = $wpdb->get_var($sql);
.
Lastly…did you consider using add_user_meta/get_user_meta instead? There’s a lot of benefits to using the native tables and functions, such as that the records get cleaned up when you delete the user and the likes.
Related Posts:
- Should I use wpdb prepare?
- Adding Widget form fields dynamically
- What is the correct way to build a widget using OOP
- $wpdb->insert_id
- Widget development – Drop down options won’t save
- Calling the widget id of a mult-instance widget from inside the widget?
- Is There A Hook To Process The Content Of The Text Widget?
- Add content to widget title in admin area within the widget?
- Has anyone managed to integrate the wp_editor inside a widget?
- Retrieving custom fields with $wpdb->get_results
- Edit the output of wp_widget_rss_output()
- Script to remove all inactive widgets?
- Possible to preset a widget’s contents via a plugin script?
- How to add multiple copies of a widget from “available widgets”
- Install widget on plugin activation
- Really simple query giving error in SQL syntax
- Custom Plugin Database relations
- why creating tables using $wpdb is not being executed while installing plugins?
- How to use mysql IN statement with wpdb update method?
- WordPress select dropdown list in widget
- Is there a need to do apply_filter(‘widget_title’, $instance[‘title’]) or any other ‘widget_xxx’ filters?
- Activation hook not creating table
- Dynamic content in a widget
- How to pass custom options from widget form to widget update callback?
- Broken markup when using the_excerpt() in a widget?
- Tips for targeting widget dragable for WP Pointer on widgets.php page
- How to create custom field in worpdress default widgets?
- Widget Admin – Form Submit Event?
- $wpdb -> Batch insert from XML File?
- Can I individually style items in the backend widget list?
- How to Download and install plugin database remotely
- Sidebar widget to show popular post not working?
- Widget update function not saving values
- Add custom element ID depending where the widget place is, sidebar or footer
- Customizer: widget-synced triggers twice
- How to insert data to a database table when the field is not yet created?
- Where to store the name of a custom table?
- include wp-blog-header not working on MAMP
- Add a class to a dynamic sidebar’s wrapper
- creating custom function to log actions in plugin
- Widget is to be compatible with all themes
- Issue regarding $wpdb->prepare()
- Error on inserting a form value to database
- How to create database table, add data, update and delete using wpdb via plugins?
- how to search users by ajax live search
- Adding custom end points, No error line
- Widget Dropdown doesn’t working
- How do I get the sub categories of the parent when in a sub category?
- How to limit number of number of categories displayed by categories widget
- Get draggable widgets on Edit Post page
- Dynamically creating classes for Widget API
- Why does my widget break other widgets?
- CSS not affecting widget output
- Using a multiple element in widget form
- $wpdb->prepare with LIKE and sprintf
- How to optimize multiple insert into wordpress database
- Create Widget or Enable Shortcodes in Sidebar
- Minimum Widget Width for Plugin Development
- $wpdb->update() always need a second try
- How to create a wordpress widget that dynamically changes according to the page
- Proper Prepare Statement for ALTER TABLE and using AFTER
- How to avoid conflicts with db.php / $wpdb and other plugins that decide to use them?
- $wpdb in php 5.5
- WordPress dynamic widget by location?
- Plugin to create Posts and Forums then choose category and parent forum
- $wpdb->update Issue
- How to relate the Category to user?
- Widget internal hooks and functions
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- My plugin creates custom widgets, How can I programatically add them to existing sidebar widget areas?
- How to show multiple instances of the WP125 Widget?
- Console errors in 6.0-RC1 Widget screen
- How to display specific data from a custom table to logged in users with a custom role
- $wpbd->insert_id is returning null
- Error code when migrate
- How to store sensitive user data (passwords)
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- Quick Draft widget (dashboard.php) using custom post_type
- WordPress Query doesn’t return the correct value
- Uncaught Error: Call to undefined function wp_get_current_user() in
- Load script on frontend from widget plugin
- Can’t get wpColorPicker to work in a widget
- If user is logged-in display/hide widgets ( siteorigine) [closed]
- User avatar-ACF fields
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- Update database record in plugin
- How to embed or integrated a custom WordPress Widget into the theme?
- Dedicated server and WPDB Class : huge slow-down of the website
- How to implement pagination into a wpdb->result query?
- Widget won’t be activated
- $wpdb how can i save my postmeta table before querying it
- Downloading Generated XML File
- wp_register_sidebar_widget in loop within a plugin?
- grouping my widgets wordpress
- Get fields of a widget
- WordPress plugin tables become corrupt
- How do I create Widget within plugin that uses its own class?
- Nothing happens on WordPress Update command
- How to specify widget order or css name via script?
- Fixing plugin for wpdb::prepare