I think you want to use get_var()
, not get_row()
– looking at the documentation, MySQL’s GREATEST
just returns a single value.
$results
will then just be the value of the greatest (be it up
or down
).
If you want the greatest up
and the greatest down
, use;
$wpdb->get_row("SELECT GREATEST(up) AS 'up', GREATEST(down) AS 'down' ...")
Related Posts:
- How to properly insert data into custom table via plugin
- How does WordPress handle MySQL row lock errors?
- Can I explicitly specify ENGINE=InnoDB in WordPress?
- Bad Request (Invalid Hostname) on working server, database problem
- Changing BIGINT to INT
- How to write one comment and publish on every post using database or plugin?
- How to determine what is generating large amount of database queries?
- Help With MySQL to WPDB Query Conversion
- get current date + 90 days and checking every day
- How can I perform high-level database merging for WordPress within continues delivery?
- WordPress Backend HA (Automatic failover)
- Automatic switch to backup database on fail
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- Multiple instance of data in plugin custom database table on plugin activation
- Better ads plugin has 500.000 entries in wp_postmeta
- after wordpress update to 3.5+ i get many errors in plugin wpdb::prepare()
- Cannot get wpdb data (Error in a simple fuction) [closed]
- How to keep variable `$post` to using in another file
- dbDelta not adding additional columns in plugin database update
- Always get creating a new table with foreign key
- How to do database for download stats?
- How can I fetch data from another website to my wordpress website with mysql database
- DB Query not working in Plugin
- External wpdb connections in different plugins on single page
- WordPress plugin: efficient way to store large data
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- How can i listing current category and Featured Category post list?
- Integrating Custom Database with WordPress
- How to display results from a data table with an encrypted user id?
- add_action for publish_post doesn’t work
- What database state changes happen after a post is manually “updated” with no changes?
- WP Function does not trigger on Webhook API Call
- Cant create table on plugin activation
- Performing CRUD operations on front end in wordpress
- How to add specific script to WordPress webpage that will working with user input and databases
- Get Shortcode output to database for static post_content
- Store GravityForm data in phpmyadmin (mysql)
- Moving a few select DB tables to a new WP instance
- WordPress database problem wp_posts, primary key
- HyperDB failover Delay
- how to repeat taxonomy in different places on wordpress
- Write mysql credentials in plugin
- How can I delete the options from DB when the plugin is deleted?
- PHP Creating a formula from mysql db values and db stored math operator
- Remove posts that start with similar words (like a delete duplicate posts plugin)
- Import posts from a different database with the same old id
- Cannot login to ADMIN even after changing password in phpmyadmin
- How to get number of Affected rows from wordpress dbDelta() function
- Unable to create new database table upon plugin activation using dbDelta
- Redeclare theme’s function in a plugin
- How to add class in plugin only for network site?
- Where to hook my plugin’s action
- Pass info from functions.php to plugin
- How does WordPress process plugin installations?
- Embed a Google Sheet as you view it in a separate tab?
- I have functions in my wordpress plugin. How do I get them to work for me?
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- Get post by ASC from custome field DATE picker
- How to create TEMPORARY Download links in a wordpress POST?
- Building an email signup form. Where should the information be saved in the DB?
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- PHP Fatal error: Call to undefined function plugin_basename
- Saving Custom Post types and fields to a custom table
- Retrieving a Value from a wp-database
- plugin development: problem with functions
- Need help restoring my WordPress blog
- MySql database help for a plugin
- add_query_arg not working
- WP plugins for building a database?
- Shortcode button dosent work for all posts. Work for first post only
- How to remove Database Table in WordPress via Function file?
- mysqli_error() expects parameter 1 to be mysqli, null given in own db class
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- Is there a way I can find wordpress posts that don’t contain a word?
- Bulk edit existing shortcode within custom field
- Prevent shortcode from being wrapped in tags
- AJAX button run function
- Dropdown menu on custom page with product to choose number of products per page
- Change wordpress current_time function to different timezone
- Inserting HTML tag with ACF into shortcode
- When to use action hooks and plugins
- Executing my function once on a specific time
- Display data on Word Press site posts and pages from mysql table
- Plugin Options Not Saving to Database in WP 4.5
- How to append to title via functions.php for auto-posting plugin [duplicate]
- How to stop or remove an action being called inside a function of an extended class
- Call to a member function have_posts() on a non-object on normal loop
- Missing Argument
- load_plugin_textdomain error
- How to override a plugin function wrapped in a class?
- Bootstrap Drop Down menu is not working
- How to Display a Plugin function (content) on frontpage using index.php
- Doubt using $wpbd->get_col for a single column
- Access WordPress database outside of WordPress
- How to create custom tables in WordPress using my own plugin?
- wordpress plugin is not activating from widget
- How to access data in wordpress database externally using php
- Theme my Login plugin, how to update fields
- Is it possible to create Custom Post plug-in?
- Edit Yoast SEO breadcrumbs output [closed]