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?
- Is it mandatory to use $wpdb->prefix in custom tables
- Adding Widget form fields dynamically
- What is the correct way to build a widget using OOP
- 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?
- $wpdb->insert is changing a value
- Actions or filters fired when data is saved in a custom table
- Retrieving custom fields with $wpdb->get_results
- Help adding image upload functionality to widget
- Edit the output of wp_widget_rss_output()
- Possible to preset a widget’s contents via a plugin script?
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- 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
- Using Ajax call in jQuery doesn’t work in widget
- 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?
- How to create custom field in worpdress default widgets?
- PHP 7 – Class Method Compatibility Issue
- Widget Admin – Form Submit Event?
- How to save WP widget instances and options
- 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
- SQL query for custom taxonomy slugs
- 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
- Intermittent database errors when accessing WordPress database
- Storing data in wordpress database from ajax call from different website
- 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
- Dynamically creating classes for Widget API
- Why does my widget break other widgets?
- CSS not affecting widget output
- wpdb->prepare and mysql UPDATE – how is it done?
- Problem with saving checkbox values with WordPress Widget API
- Are there any official or unofficial guidelines for the styling of a widget?
- 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
- Data inserted by wpdb insert is different than data pressnt in database.
- $wpdb->prepare is not working like mysql_real_escape_string
- How to avoid conflicts with db.php / $wpdb and other plugins that decide to use them?
- $wpdb in php 5.5
- Plugin to create Posts and Forums then choose category and parent forum
- Can / should a widget plugin define its own Widget Area?
- How to exclude categories from get_categories() select list inside a widget admin panel
- Widget internal hooks and functions
- WordPress database error: [Query was empty] – using $wpdb->prepare()
- Why doesn’t my Table get created?
- 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?
- How to display specific data from a custom table to logged in users with a custom role
- $wpbd->insert_id is returning null
- How does update method in Widget class saves $instance array from Select tag?
- How to get inserted row IDs for bulk/batch insert with wpdb query?
- Load script on frontend from widget plugin
- Can’t get wpColorPicker to work in a widget
- Set widget icon in Customizer?
- Update database record in plugin
- Dedicated server and WPDB Class : huge slow-down of the website
- How to CRUD from wordpress database in wordpress theme?
- Widget won’t be activated
- Dynamic sidebar areas not working on the Theme Customizer
- I can’t write in my DB using $wpdb->insert
- $wpdb how can i save my postmeta table before querying it
- Downloading Generated XML File
- Detect each active instance of a widget
- 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?
- Best practice to include custom user styles in widgets
- Nothing happens on WordPress Update command
- Fixing plugin for wpdb::prepare