You have a problem with your query which is you can’t use GROUP BY
and ORDER BY
before WHERE
replace
FROM tablename GROUP BY submit_time ORDER BY submit_time DESC
with
FROM tablename
This is your query
$results = $wpdb->get_results( 'SELECT DATE_FORMAT(FROM_UNIXTIME(submit_time), "%b %e, %Y %l:%i %p") AS Submitted,
MAX(IF(field_name="Name", field_value, NULL )) AS "Name",
MAX(IF(field_name="Email", field_value, NULL )) AS "Email",
MAX(IF(field_name="Subject", field_value, NULL )) AS "Position",
MAX(IF(field_name="Message", field_value, NULL )) AS "Message"
FROM tablename
WHERE
form_name = "Resume"
GROUP BY submit_time
ORDER BY submit_time DESC', ARRAY_A);
Related Posts:
- $wpdb->get_results in not an array
- Fetch array with $wpdb
- Create an array with a string key from wpdb->get_results
- Undefined offset: 0
- Save data from a checkbox to a wpdb array
- MySQL Query Returns Array () In Shortcode
- Convert a column of a table containing an Array as response in HTML
- PHP | left join avg query give me Array()
- Access to numerically indexed array in wpdb Class and undefined offset
- Get 3 row ID’s via ARRAY_A
- Echo only gives me the first part of string
- wpdb select from using array as search parameters
- wpdb Cannot Access Associative Array Data in a Count Query
- Can’t seem to get set_blog_id working, it just doesn’t reset the blog ID
- How do I fetch each row as an associative array using $wpdb?
- Issue running db create table query from static method
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- Add first letter of titles to array, then compare arrays
- How can I access string value in an array?
- WordPress core code contains things marked as deprecated by… WordPress?
- How to use if statement in an array? [closed]
- Error using WordPress $wpdb object to get result from custom table
- How to array only one key from another array
- Getting variable from Database
- How to retrieve the data from the sever and displaying it in a page?
- Filtering a function’ output for a new continued function
- Output meta into arrays
- Querying Database with wpdb
- How do I turn these values from MYSQL into an array
- Get html data with javascript to php array and store to wordpress database
- $wpdb returns duplicate posts
- Can’t update multiple rows with $wpdb query
- How do I count columns on a custom WPDB query?
- how to get db values without using an loop with wpdb->get_results()
- How do I create a numbered list with PHP? [closed]
- Create new database through static page code
- $wpdb – joining shows no result
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Mixing variables into an array when inserting values
- Custom SQL query ORDER BY term_order
- Custom $wpdb returns unexpected time based results
- How to use array in function to get only value I want
- Error while setting role
- Get categories names as an array to use it in theme settings
- Trouble inserting string containing quotations marks with wpdb in save_post hook
- Wpdb->insert() doesn’t insert new row after the last one
- Compare transient data with a meta box value
- how to get serialized post meta
- How to left join meta in queries [closed]
- How to run wp_insert_post() & wpdb on the background?
- Register custom table for WP to use in a plugin
- How to get the last category name of a child category?
- How to say if meta_value is greater than 0 in an array?
- How to use two meta_compare in an array?
- Any idea how to get something like this to work? [closed]
- Warning: in_array() null given in PHP function
- $wpdb->prepare was called incorrectly when inserting multiple records
- How to protect a script execution on WordPress?
- Trying to get variable from WP table and toggle its value
- wpdb->get_row is selecting the variable as a column name
- Set MySQL variables in WPDB
- Use $wpdb or other PHP script method to find/replace in WP database
- get_results query with accent
- Foreach loop inside an array_merge
- CREATE TABLE with dbDelta does not create table
- How can I add a new row in a separate database when someone registers via WordPress?
- How to get specific attribute from DB
- Loop over Array and get the distinct ids
- Basic wpdb update question
- WordPress “wpdb->update” – Append Text Value
- How to access or parse key/values that have “string”
- If Array Values Match Another Array’s Values, Then
- Remove empty terms from array, sort alphabetically, update back to repeating field
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- Conditional multidimensional arrays and array_map
- How to prepare an array of values with $wpdb
- I can’t update my data through $wpdb
- wpdb Cannot Update column in Database
- Display category names on edit user profile using $wpdb
- Output: “Array”
- Is querying wpdb directly and skipping actions provided by WP’s core “wp_update_post” a good idea?
- How can I get all values from my array in a loop in php? [closed]
- How to use mysql LIKE with wpdb?
- Getting posts to exclude from array
- Get all posts as an array ID => Name
- PHP -> SQL Query with Summing
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- WP-PostRatings: list current user’s rated posts
- Delete database record using plugin from admin panel
- how to connect to another database in wordpress
- I’m unable to call img path using single quotes in an array?
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Get unique results from this function
- Filter by field with array value in ACF on WP REST API
- Need help converting get_user_meta [keys] into own array
- Cannot access $wpdb, comes back NULL
- extract serialized array to use for wp-query
- Wpdb get->results to out the the month from the db
- get users search not working with array