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
- Delete tables from database when deleting plugin
- WordPress sharding: which multi-DB plugin to use?
- Need to create a Theme demo site that features multiple themes
- How do I check what plugins are enabled via the database?
- Why does including a file in theme’s functions.php not work?
- Add Top-Level Menu that opens URL
- prefix table and plugins
- WordPress ajax call for not logged in users, doesn’t work
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- Add a plugin before main container
- Get all categories of custom post even not assigned
- Function to prevent users from trashing comments
- What kind of data is that?
- Cannot login to ADMIN even after changing password in phpmyadmin
- How does WordPress process plugin installations?
- Embed a Google Sheet as you view it in a separate tab?
- Conditionally add apt. Open Graph meta data to different pages on WordPress site
- wordpress plugin is not activating from widget
- How to use a class from another plugin
- Prevent duplicate records in plugin table
- WpDataTables – View Image Directory
- How to remove custom post type and add category and post name
- Why this function not working for install database on plugin activation
- bbPress plugin: forum lists not showing in correct order? [closed]
- 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
- 5 PHP Fatal error: Uncaught ArgumentCountError (Cannot Find)
- Getting a ressource ID, from a WC_Order_Item_Product/Order
- Execute a function when the entire page is displayed
- 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
- How to allow URL with filename & extension in wordpress?
- 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 database to use it in wordpress website?
- How to create a custom page for unrelated database?
- User content database [closed]
- Conditional required fields for WordPress Contact Form 7
- 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
- How to Allow Users to Select Recipients In a WordPress Comment section?
- How often should I execute add_filter and function declaration in Code Snippets?
- Form with response button after on table after submission
- Product customizing quiz – quiz adding products to the cart
- How to change all the urls of the WordPress site?
- Split Million WordPress Post’s Into Multiple Database Server