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)
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- Define Function in functions.php or plugin and call in theme loop
- Autogenerate wordpress shortcodes using array?
- WooCommerce create new product and add to cart on form submit
- Shortcode under a Shortcode Multiple times Possible?
- What is the easiest way to implement cascading database upgrade for my plugin?
- Override plugin functions in functions.php
- Remove obsolete plugins artifacts from database tables
- Display a text message if the field is not found and not if found
- Is the wordpress user-model changed in wpmu?
- Creating Tables on Network Activation
- Where to hook my plugin’s action
- Building an email signup form. Where should the information be saved in the DB?
- plugin development: problem with functions
- Custom random quote widget breaks when used in multiple sidebars
- Override Plugin Script Fucnction in WordPress
- Conditional attributes and logic per product category
- WordPress page and plugin list using sql query
- WordPress and a secondary database?
- bbPress plugin: forum lists not showing in correct order? [closed]
- Order posts alphabetically: how to set order=asc in mysql query?
- WordPress : Explain Plugins & Theme string value in database
- Is there a best practice remediation for PhpStorm’s warning that void function the_post_thumbnail is used?
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- How to reset the plugins without deactivate the plugin
- plugins_url() works everywhere but wp_reqister_script()
- Replacing global wp_query
- WordPress Stock Update Programatically
- 5 PHP Fatal error: Uncaught ArgumentCountError (Cannot Find)
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- same user role or copy the user role to be same as the other role
- Execute a function when the entire page is displayed
- Getting URL GET parameter with Code snippets and storing it in database?
- Same Plugin tables between wordpress installations
- How would I get the new plugin version on this function?
- How to get the custom field value using SQL query
- Need to know if my approach to designing a geneaology plug-in for wordpress makes sense
- Modify function output in a plugin
- Is admin section completely customizable in terms of styling?
- Migrating custom php we wrote from functions.php into a site-specific plugin
- How to create a custom page for unrelated database?
- User content database [closed]
- Conditional required fields for WordPress Contact Form 7
- Help with sorting and storing data on WordPress
- WordPress plugin options need to delete after deactivate & uninstall
- WordPress function to add text
- get post excerpt by query
- How to find an option in the database?
- Sync roles across several plugins
- get_option returning a different value from what’s saved
- Form with response button after on table after submission
- Split Million WordPress Post’s Into Multiple Database Server
- Re-use date format on different template
- Remove and strip html tag values